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
This commit is contained in:
Andrew Nacin 2013-09-14 20:20:46 +00:00
parent db7501f3fa
commit 730574eeb5
1 changed files with 6 additions and 2 deletions

View File

@ -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',