WordPress.org

Make WordPress Core

Ticket #24115: 24115.diff

File 24115.diff, 1.6 KB (added by DrewAPicture, 12 months ago)
  • wp-admin/nav-menus.php

     
    470470wp_nav_menu_setup(); 
    471471wp_initial_nav_menu_meta_boxes(); 
    472472 
    473 if ( ! current_theme_supports( 'menus' ) && ! wp_get_nav_menus() ) 
     473if ( ! current_theme_supports( 'menus' ) && 0 == $num_locations ) 
    474474        $messages[] = '<div id="message" class="updated"><p>' . __('The current theme does not natively support menus, but you can use the &#8220;Custom Menu&#8221; widget to add any menus you create here to the theme&#8217;s sidebar.') . '</p></div>'; 
    475475 
    476476if ( ! $locations_screen ) : // Main tab 
     
    536536        <?php screen_icon(); ?> 
    537537        <h2 class="nav-tab-wrapper"> 
    538538                <a href="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-tab<?php if ( ! isset( $_GET['action'] ) || isset( $_GET['action'] ) && 'locations' != $_GET['action'] ) echo ' nav-tab-active'; ?>"><?php esc_html_e( 'Edit Menus' ); ?></a> 
    539                 <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>" class="nav-tab<?php if ( $locations_screen ) echo ' nav-tab-active'; ?>"><?php esc_html_e( 'Manage Locations' ); ?></a> 
     539                <?php if ( $num_locations >= 1 && $menu_count >= 1 ) : ?> 
     540                        <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>" class="nav-tab<?php if ( $locations_screen ) echo ' nav-tab-active'; ?>"><?php esc_html_e( 'Manage Locations' ); ?></a> 
     541                <?php endif; ?> 
    540542        </h2> 
    541543        <?php 
    542544        foreach( $messages as $message ) :