mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Avoid a PHP notice in wp_enqueue_script()
if $handle is an array.
Calling `wp_enqueue_script()` with an array as the first argument is a "hidden feature" and should be avoided. Use dependencies instead. props sorich87 for initial patch. fixes #31636. see #14488. Built from https://develop.svn.wordpress.org/trunk@31887 git-svn-id: http://core.svn.wordpress.org/trunk@31866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
29907e5f8b
commit
4fbba16960
@ -209,7 +209,7 @@ function wp_deregister_script( $handle ) {
|
||||
* @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.
|
||||
*
|
||||
* @since 2.6.0
|
||||
|
||||
*
|
||||
* @param string $handle Name of the script.
|
||||
* @param string|bool $src Path to the script from the root directory of WordPress. Example: '/js/myscript.js'.
|
||||
* @param array $deps An array of registered handles this script depends on. Default empty array.
|
||||
@ -224,6 +224,8 @@ function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false
|
||||
|
||||
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
|
||||
|
||||
|
||||
if ( $src || $in_footer ) {
|
||||
$_handle = explode( '?', $handle );
|
||||
|
||||
if ( $src ) {
|
||||
@ -233,6 +235,7 @@ function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false
|
||||
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-beta2-31886';
|
||||
$wp_version = '4.2-beta2-31887';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user