mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Script Loader: Introduce wp_add_inline_script().
This new function can be used to add inline JavaScript before and after enqueued scripts, just like `wp_add_inline_style()` works for CSS. Props atimmer, abiralneupane, ocean90, swissspidy. Fixes #14853. git-svn-id: https://develop.svn.wordpress.org/trunk@36633 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -992,6 +992,10 @@ 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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user