WordPress.org

Make WordPress Core

Ticket #24228: 24228.diff

File 24228.diff, 1.1 KB (added by kovshenin, 12 months ago)
  • wp-admin/nav-menus.php

     
    379379$page_count = wp_count_posts( 'page' ); 
    380380$one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) ? true : false; 
    381381 
    382 $l10n = array( 
     382$nav_menus_l10n = array( 
    383383        'oneThemeLocationNoMenus' => $one_theme_location_no_menus, 
    384384        'moveUp'       => __( 'Move up one' ), 
    385385        'moveDown'     => __( 'Move down one' ), 
     
    397397        /* translators: 1: item name, 2: item position, 3: parent item name */ 
    398398        'subMenuFocus' => __( '%1$s. Sub item number %2$d under %3$s.' ), 
    399399); 
    400 wp_localize_script( 'nav-menu', 'menus', $l10n ); 
     400wp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n ); 
    401401 
    402402// Redirect to add screen if there are no menus and this users has either zero, or more than 1 theme locations 
    403403if ( 0 == $menu_count && ! $add_new_screen && ! $one_theme_location_no_menus )