Script/Style Dependencies: Make sure that inline scripts for handles without a source are printed.
See [36550] for `WP_Styles`. Merges [43565] to the 5.0 branch. Props bpayton. Fixes #44551. Built from https://develop.svn.wordpress.org/branches/5.0@43788 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
49702cca54
commit
a618939ddb
|
@ -266,6 +266,12 @@ class WP_Scripts extends WP_Dependencies {
|
|||
$after_handle = sprintf( "<script type='text/javascript'>\n%s\n</script>\n", $after_handle );
|
||||
}
|
||||
|
||||
if ( $before_handle || $after_handle ) {
|
||||
$inline_script_tag = "{$cond_before}{$before_handle}{$after_handle}{$cond_after}";
|
||||
} else {
|
||||
$inline_script_tag = '';
|
||||
}
|
||||
|
||||
if ( $this->do_concat ) {
|
||||
/**
|
||||
* Filters the script loader source.
|
||||
|
@ -307,7 +313,15 @@ class WP_Scripts extends WP_Dependencies {
|
|||
}
|
||||
|
||||
// A single item may alias a set of items, by having dependencies, but no source.
|
||||
if ( ! $obj->src ) {
|
||||
if ( ! $src ) {
|
||||
if ( $inline_script_tag ) {
|
||||
if ( $this->do_concat ) {
|
||||
$this->print_html .= $inline_script_tag;
|
||||
} else {
|
||||
echo $inline_script_tag;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.0-alpha-43787';
|
||||
$wp_version = '5.0-alpha-43788';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue