Make WordPress Core


Ignore:
Timestamp:
07/22/2015 01:25:13 AM (9 years ago)
Author:
jeremyfelt
Message:

Nav Menus: Add a Menus title with Manage in Customizer button to nav-menus.php

This aligns the <h1> on wp-admin/nav-menus.php with that of other admin screens and aligns the "Manage in Customizer" button with that on wp-admin/widgets.php.

Fixes #32808.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/nav-menus.php

    r33174 r33355  
    559559?>
    560560<div class="wrap">
    561     <h1 class="nav-tab-wrapper">
     561    <h1><?php echo esc_html( __( 'Menus' ) ); ?>
     562        <?php
     563        if ( current_user_can( 'customize' ) ) :
     564            $focus = $locations_screen ? array( 'section' => 'menu_locations' ) : array( 'panel' => 'nav_menus' );
     565            printf(
     566                ' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>',
     567                esc_url( add_query_arg( array(
     568                    array( 'autofocus' => $focus ),
     569                    'return' => urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
     570                ), admin_url( 'customize.php' ) ) ),
     571                __( 'Manage in Customizer' )
     572            );
     573        endif;
     574        ?>
     575    </h1>
     576    <h2 class="nav-tab-wrapper">
    562577        <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>
    563578        <?php if ( $num_locations && $menu_count ) : ?>
     
    565580        <?php
    566581            endif;
    567 
    568             if ( current_user_can( 'customize' ) ) :
    569                 $focus = $locations_screen ? array( 'section' => 'menu_locations' ) : array( 'panel' => 'nav_menus' );
    570                 printf(
    571                     ' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>',
    572                     esc_url( add_query_arg( array(
    573                         array( 'autofocus' => $focus ),
    574                         'return' => urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
    575                     ), admin_url( 'customize.php' ) ) ),
    576                     __( 'Manage in Customizer' )
    577                 );
    578             endif;
    579582        ?>
    580     </h1>
     583    </h2>
    581584    <?php
    582585    foreach( $messages as $message ) :
Note: See TracChangeset for help on using the changeset viewer.