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.

Built from https://develop.svn.wordpress.org/trunk@25443


git-svn-id: http://core.svn.wordpress.org/trunk@25364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-09-14 20:21:09 +00:00
parent 9414d6e40e
commit 0fbb5a32ef
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(); $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. // Do not allow accidental or negligent deregistering of critical scripts in the admin.
if ( is_admin() && 'admin_enqueue_scripts' !== current_filter() ) { // 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( $no = array(
'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion', 'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion',
'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog', 'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog',