wp_add_inline_style():

* Change the `wp-inline-style-$handle` class added in [29956] to `$handle-inline-css` for consistency with existing patterns.
* Add the ID attribute when concatenation is enabled as well.

props georgestephanis.
see #30032.

git-svn-id: https://develop.svn.wordpress.org/trunk@29958 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2014-10-18 19:03:11 +00:00
parent 97b07876cb
commit a1b5440d4b
1 changed files with 2 additions and 4 deletions

View File

@ -110,7 +110,7 @@ class WP_Styles extends WP_Dependencies {
if ( $this->do_concat ) {
$this->print_html .= $tag;
if ( $inline_style = $this->print_inline_style( $handle, false ) )
$this->print_html .= sprintf( "<style type='text/css'>\n%s\n</style>\n", $inline_style );
$this->print_html .= sprintf( "<style id='%s-inline-css' type='text/css'>\n%s\n</style>\n", esc_attr( $handle ), $inline_style );
} else {
echo $tag;
$this->print_inline_style( $handle );
@ -147,9 +147,7 @@ class WP_Styles extends WP_Dependencies {
return $output;
}
echo "<style id='wp-inline-style-" . esc_attr( $handle ) . "' type='text/css'>\n";
echo "$output\n";
echo "</style>\n";
printf( "<style id='%s-inline-css' type='text/css'>\n%s\n</style>\n", esc_attr( $handle ), $output );
return true;
}