mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-29 15:44:27 +00:00
Script/Style Dependencies: Make sure that inline styles for handles without a source are printed.
This prevents breaking plugins which are adding inline styles to the `wp-admin` handle after [36341]. Props dd32, ocean90. Fixes #35229. git-svn-id: https://develop.svn.wordpress.org/trunk@36550 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -72,11 +72,20 @@ class WP_Styles extends WP_Dependencies {
|
||||
else
|
||||
$media = 'all';
|
||||
|
||||
$href = $this->_css_href( $obj->src, $ver, $handle );
|
||||
if ( empty( $href ) ) {
|
||||
// Turns out there is nothing to print.
|
||||
// A single item may alias a set of items, by having dependencies, but no source.
|
||||
if ( ! $obj->src ) {
|
||||
if ( $inline_style = $this->print_inline_style( $handle, false ) ) {
|
||||
$inline_style = sprintf( "<style id='%s-inline-css' type='text/css'>\n%s\n</style>\n", esc_attr( $handle ), $inline_style );
|
||||
if ( $this->do_concat ) {
|
||||
$this->print_html .= $inline_style;
|
||||
} else {
|
||||
echo $inline_style;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
$href = $this->_css_href( $obj->src, $ver, $handle );
|
||||
$rel = isset($obj->extra['alt']) && $obj->extra['alt'] ? 'alternate stylesheet' : 'stylesheet';
|
||||
$title = isset($obj->extra['title']) ? "title='" . esc_attr( $obj->extra['title'] ) . "'" : '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user