mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Speed up jQuery based scripts, props Denis-de-Bernardy, see #10021
git-svn-id: https://develop.svn.wordpress.org/trunk@11837 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -15,9 +15,19 @@ require_once(ABSPATH . 'wp-admin/includes/widgets.php');
|
||||
if ( ! current_user_can('switch_themes') )
|
||||
wp_die( __( 'Cheatin’ uh?' ));
|
||||
|
||||
wp_enqueue_script('admin-widgets');
|
||||
wp_admin_css( 'widgets' );
|
||||
|
||||
$widgets_access = get_user_setting( 'widgets_access' );
|
||||
if ( isset($_GET['widgets-access']) ) {
|
||||
$widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
|
||||
set_user_setting( 'widgets_access', $widgets_access );
|
||||
}
|
||||
|
||||
if ( 'on' == $widgets_access )
|
||||
add_filter( 'admin_body_class', create_function('', '{return " widgets_access ";}') );
|
||||
else
|
||||
wp_enqueue_script('admin-widgets');
|
||||
|
||||
do_action( 'sidebar_admin_setup' );
|
||||
|
||||
$title = __( 'Widgets' );
|
||||
@@ -302,15 +312,6 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$widgets_access = get_user_setting( 'widgets_access' );
|
||||
if ( isset($_GET['widgets-access']) ) {
|
||||
$widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
|
||||
set_user_setting( 'widgets_access', $widgets_access );
|
||||
}
|
||||
|
||||
if ( 'on' == $widgets_access )
|
||||
add_filter( 'admin_body_class', create_function('', '{return " widgets_access ";}') );
|
||||
|
||||
$messages = array(
|
||||
__('Changes saved.')
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user