Make WordPress Core


Ignore:
Timestamp:
08/18/2009 09:53:37 AM (16 years ago)
Author:
azaozz
Message:

Speed up jQuery based scripts, props Denis-de-Bernardy, see #10021

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/widgets.php

    r11824 r11837  
    1616    wp_die( __( 'Cheatin’ uh?' ));
    1717
    18 wp_enqueue_script('admin-widgets');
    1918wp_admin_css( 'widgets' );
     19
     20$widgets_access = get_user_setting( 'widgets_access' );
     21if ( isset($_GET['widgets-access']) ) {
     22    $widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
     23    set_user_setting( 'widgets_access', $widgets_access );
     24}
     25
     26if ( 'on' == $widgets_access )
     27    add_filter( 'admin_body_class', create_function('', '{return " widgets_access ";}') );
     28else
     29    wp_enqueue_script('admin-widgets');
    2030
    2131do_action( 'sidebar_admin_setup' );
     
    303313}
    304314
    305 $widgets_access = get_user_setting( 'widgets_access' );
    306 if ( isset($_GET['widgets-access']) ) {
    307     $widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
    308     set_user_setting( 'widgets_access', $widgets_access );
    309 }
    310 
    311 if ( 'on' == $widgets_access )
    312     add_filter( 'admin_body_class', create_function('', '{return " widgets_access ";}') );
    313 
    314315$messages = array(
    315316    __('Changes saved.')
Note: See TracChangeset for help on using the changeset viewer.