mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Script Loader: Explicitly declare the $pagenow global in wp_deregister_script().
This avoids an "Undefined index" PHP notice in `wp_resource_hints()` tests when running the full test suite. Remove the unused global from `get_home_url()`. Follow-up to [25443], [38100], [38174], [50156], [50164]. Props peterwilsoncc. Fixes #52566. git-svn-id: https://develop.svn.wordpress.org/trunk@50393 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -258,9 +258,13 @@ function wp_set_script_translations( $handle, $domain = 'default', $path = null
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @global string $pagenow
|
||||
*
|
||||
* @param string $handle Name of the script to be removed.
|
||||
*/
|
||||
function wp_deregister_script( $handle ) {
|
||||
global $pagenow;
|
||||
|
||||
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );
|
||||
|
||||
/**
|
||||
@@ -269,7 +273,7 @@ function wp_deregister_script( $handle ) {
|
||||
*/
|
||||
$current_filter = current_filter();
|
||||
if ( ( is_admin() && 'admin_enqueue_scripts' !== $current_filter ) ||
|
||||
( 'wp-login.php' === $GLOBALS['pagenow'] && 'login_enqueue_scripts' !== $current_filter )
|
||||
( 'wp-login.php' === $pagenow && 'login_enqueue_scripts' !== $current_filter )
|
||||
) {
|
||||
$not_allowed = array(
|
||||
'jquery',
|
||||
|
||||
Reference in New Issue
Block a user