Make WordPress Core


Ignore:
Timestamp:
03/06/2013 07:34:01 PM (12 years ago)
Author:
markjaquith
Message:

Tweak the Nav Menu UX, especially around menu creation.

props lessbloat, DrewAPicture, jkudish. fixes #23641

File:
1 edited

Legend:

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

    r23554 r23622  
    454454<div class="wrap">
    455455    <?php screen_icon(); ?>
    456     <h2><?php _e( 'Menus' ); ?> <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0, ), admin_url( 'nav-menus.php' ) ) ); ?>" class="add-new-h2"><?php _e( 'Add New' ); ?></a></h2>
     456    <h2><?php _e( 'Menus' ); ?></h2>
    457457    <?php
    458458    foreach( $messages as $message ) :
     
    460460    endforeach;
    461461    ?>
    462     <?php if ( 1 < $menu_count ) : ?>
    463     <form method="post" action="<?php echo admin_url( 'nav-menus.php' ); ?>">
    464         <input type="hidden" name="action" value="edit" />
    465         <div class="manage-menus">
    466             <label for="menu" class="selected-menu"><?php _e('Select menu to edit'); ?></label>
     462    <div class="manage-menus">
     463    <?php if ( $menu_count < 2 ) : ?>
     464        <span class="add-edit-menu-action">
     465            <?php printf( __( 'Edit your menu below, or <a href="%s">create a new menu</a>.' ), esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0 ), admin_url( 'nav-menus.php' ) ) ) ); ?>
     466        </span><!-- /add-edit-menu-action -->
     467    <?php else : ?>
     468        <form method="post" action="<?php echo admin_url( 'nav-menus.php' ); ?>">
     469            <input type="hidden" name="action" value="edit" />
     470            <label for="menu" class="selected-menu"><?php _e( 'Select a menu to edit:' ); ?></label>
    467471            <select name="menu" id="menu">
    468472                <?php if ( $add_new_screen ) : ?>
     
    492496            </select>
    493497            <span class="submit-btn"><input type="submit" class="button-secondary" value="<?php _e( 'Select' ); ?>"></span>
    494         </div>
    495     </form>
     498            <span class="add-new-menu-action">
     499                <?php printf( __( 'or <a href="%s">create a new menu</a>.' ), esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0 ), admin_url( 'nav-menus.php' ) ) ) ); ?>
     500            </span><!-- /add-new-menu-action -->
     501        </form>
    496502    <?php endif; ?>
     503    </div><!-- /manage-menus -->
    497504    <div id="nav-menus-frame">
    498505    <div id="menu-settings-column" class="metabox-holder<?php if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) { echo ' metabox-holder-disabled'; } ?>">
Note: See TracChangeset for help on using the changeset viewer.