Ensure consistent dependency order when using wp_add_inline_script()

This disables the concatenation of remaining enqueued scripts once `wp_add_inline_script()` is invoked, which allows us to reliably print these scripts and their before/after inline scripts in the desired order.

Props gitlost, azaozz, swisspidy, ocean90.
Fixes #36392.


git-svn-id: https://develop.svn.wordpress.org/trunk@37171 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt
2016-04-10 03:32:47 +00:00
parent fc1f8db19a
commit f98744ec86
3 changed files with 226 additions and 38 deletions

View File

@@ -998,10 +998,6 @@ function _print_scripts() {
echo "</script>\n";
}
if ( ! empty( $wp_scripts->print_html_before ) ) {
echo $wp_scripts->print_html_before;
}
$concat = str_split( $concat, 128 );
$concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat );