From 730574eeb573e914ec3e22df9836ea6ff92d3909 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 14 Sep 2013 20:20:46 +0000 Subject: [PATCH] Don't allow critical scripts to be deregistered on wp-login.php, just as we do in the rest of the admin. props atimmer. fixes #25017. git-svn-id: https://develop.svn.wordpress.org/trunk@25443 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.wp-scripts.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/functions.wp-scripts.php b/src/wp-includes/functions.wp-scripts.php index 32778ab5a2..97c2e37097 100644 --- a/src/wp-includes/functions.wp-scripts.php +++ b/src/wp-includes/functions.wp-scripts.php @@ -111,8 +111,12 @@ function wp_deregister_script( $handle ) { $wp_scripts = new WP_Scripts(); } - // Do not allow accidental or negligent deregistering of critical scripts in the admin. Show minimal remorse if the correct hook is used. - if ( is_admin() && 'admin_enqueue_scripts' !== current_filter() ) { + // Do not allow accidental or negligent deregistering of critical scripts in the admin. + // Show minimal remorse if the correct hook is used. + $current_filter = current_filter(); + if ( ( is_admin() && 'admin_enqueue_scripts' !== $current_filter ) || + ( 'wp-login.php' === $GLOBALS['pagenow'] && 'login_enqueue_scripts' !== $current_filter ) + ) { $no = array( 'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion', 'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog',