From 26c8088a97ca4210025f00ac1be7ac05e3dac331 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 18 Oct 2014 17:58:19 +0000 Subject: [PATCH] Add ID attribute to style element from wp_add_inline_style(). props westonruter. fixes #30032. Built from https://develop.svn.wordpress.org/trunk@29956 git-svn-id: http://core.svn.wordpress.org/trunk@29703 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class.wp-styles.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wp-includes/class.wp-styles.php b/wp-includes/class.wp-styles.php index 1a017ac5a4..23cb95a968 100644 --- a/wp-includes/class.wp-styles.php +++ b/wp-includes/class.wp-styles.php @@ -120,12 +120,14 @@ class WP_Styles extends WP_Dependencies { } public function add_inline_style( $handle, $code ) { - if ( !$code ) + if ( ! $code ) { return false; + } $after = $this->get_data( $handle, 'after' ); - if ( !$after ) + if ( ! $after ) { $after = array(); + } $after[] = $code; @@ -135,15 +137,17 @@ class WP_Styles extends WP_Dependencies { public function print_inline_style( $handle, $echo = true ) { $output = $this->get_data( $handle, 'after' ); - if ( empty( $output ) ) + if ( empty( $output ) ) { return false; + } $output = implode( "\n", $output ); - if ( !$echo ) + if ( ! $echo ) { return $output; + } - echo "\n";