mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-01 21:21:24 +01:00
When calling wp_enqueue_script()
with a registered $handle
, no $src
(using the default value, false
), and true
as the value for $in_footer
, ensure that the script actually loads in the footer. If the handle was registered with $in_footer
equal to true
, this already worked. Make it work for scripts like where $in_footer
was initially false
, example: wp_enqueue_script( 'json2', false, array(), false, true );
Props SergeyBiryukov. Fixes #14488. Built from https://develop.svn.wordpress.org/trunk@31028 git-svn-id: http://core.svn.wordpress.org/trunk@31009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a374f9f092
commit
2d7c3eec73
@ -203,12 +203,16 @@ function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false
|
||||
$wp_scripts = new WP_Scripts();
|
||||
}
|
||||
|
||||
$_handle = explode( '?', $handle );
|
||||
|
||||
if ( $src ) {
|
||||
$_handle = explode('?', $handle);
|
||||
$wp_scripts->add( $_handle[0], $src, $deps, $ver );
|
||||
if ( $in_footer )
|
||||
$wp_scripts->add_data( $_handle[0], 'group', 1 );
|
||||
}
|
||||
|
||||
if ( $in_footer ) {
|
||||
$wp_scripts->add_data( $_handle[0], 'group', 1 );
|
||||
}
|
||||
|
||||
$wp_scripts->enqueue( $handle );
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-alpha-31027';
|
||||
$wp_version = '4.2-alpha-31028';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user