From 112c98f71ebf10811e1e8e75f56b49d01db0d7d9 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 18 Oct 2014 17:57:23 +0000 Subject: [PATCH] Add ID attribute to style element from wp_add_inline_style(). props westonruter. fixes #30032. git-svn-id: https://develop.svn.wordpress.org/trunk@29956 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class.wp-styles.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/class.wp-styles.php b/src/wp-includes/class.wp-styles.php index 1a017ac5a4..23cb95a968 100644 --- a/src/wp-includes/class.wp-styles.php +++ b/src/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";