WordPress.org

Make WordPress Core

Ticket #18853: 18853.3.patch

File 18853.3.patch, 1.2 KB (added by SergeyBiryukov, 7 years ago)

Fixes admin_body_class on Widgets screen as well

  • wp-admin/nav-menus.php

     
    432432if ( is_nav_menu( $nav_menu_selected_id ) )
    433433        $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id  );
    434434
    435 function wp_nav_menu_max_depth() {
     435function wp_nav_menu_max_depth( $classes ) {
    436436        global $_wp_nav_menu_max_depth;
    437         return "menu-max-depth-$_wp_nav_menu_max_depth";
     437        return "$classes menu-max-depth-$_wp_nav_menu_max_depth";
    438438}
     439add_filter('admin_body_class', 'wp_nav_menu_max_depth');
    439440
    440 add_action('admin_body_class','wp_nav_menu_max_depth');
    441 
    442441wp_nav_menu_setup();
    443442wp_initial_nav_menu_meta_boxes();
    444443
  • wp-admin/widgets.php

     
    2222}
    2323
    2424if ( 'on' == $widgets_access )
    25         add_filter( 'admin_body_class', create_function('', '{return " widgets_access ";}') );
     25        add_filter( 'admin_body_class', create_function('$classes', '{return "$classes widgets_access";}') );
    2626else
    2727        wp_enqueue_script('admin-widgets');
    2828