Changeset 42217 for trunk/src/wp-admin/nav-menus.php
- Timestamp:
- 11/23/2017 04:08:42 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/nav-menus.php
r41868 r42217 590 590 ); 591 591 endif; 592 593 $nav_tab_active_class = ''; 594 if ( ! isset( $_GET['action'] ) || isset( $_GET['action'] ) && 'locations' != $_GET['action'] ) { 595 $nav_tab_active_class = ' nav-tab-active'; 596 } 592 597 ?> 593 598 … … 595 600 596 601 <h2 class="nav-tab-wrapper wp-clearfix"> 597 <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>602 <a href="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-tab<?php echo $nav_tab_active_class; ?>"><?php esc_html_e( 'Edit Menus' ); ?></a> 598 603 <?php if ( $num_locations && $menu_count ) : ?> 599 604 <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> … … 631 636 <select name="menu-locations[<?php echo $_location; ?>]" id="locations-<?php echo $_location; ?>"> 632 637 <option value="0"><?php printf( '— %s —', esc_html__( 'Select a Menu' ) ); ?></option> 633 <?php foreach ( $nav_menus as $menu ) : ?> 634 <?php $selected = isset( $menu_locations[$_location] ) && $menu_locations[$_location] == $menu->term_id; ?> 635 <option <?php if ( $selected ) echo 'data-orig="true"'; ?> <?php selected( $selected ); ?> value="<?php echo $menu->term_id; ?>"> 638 <?php 639 foreach ( $nav_menus as $menu ) : 640 $data_orig = ''; 641 $selected = isset( $menu_locations[$_location] ) && $menu_locations[$_location] == $menu->term_id; 642 if ( $selected ) { 643 $data_orig = 'data-orig="true"'; 644 } 645 ?> 646 <option <?php echo $data_orig; ?> <?php selected( $selected ); ?> value="<?php echo $menu->term_id; ?>"> 636 647 <?php echo wp_html_excerpt( $menu->name, 40, '…' ); ?> 637 648 </option> … … 722 733 </span><!-- /add-new-menu-action --> 723 734 </form> 724 <?php endif; ?> 735 <?php 736 endif; 737 738 $metabox_holder_disabled_class = ''; 739 if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) { 740 $metabox_holder_disabled_class = ' metabox-holder-disabled'; 741 } 742 ?> 725 743 </div><!-- /manage-menus --> 726 744 <div id="nav-menus-frame" class="wp-clearfix"> 727 <div id="menu-settings-column" class="metabox-holder<?php if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) { echo ' metabox-holder-disabled'; }?>">745 <div id="menu-settings-column" class="metabox-holder<?php echo $metabox_holder_disabled_class; ?>"> 728 746 729 747 <div class="clear"></div> … … 740 758 <div id="menu-management"> 741 759 <form id="update-nav-menu" method="post" enctype="multipart/form-data"> 742 <div class="menu-edit <?php if ( $add_new_screen ) echo 'blank-slate'; ?>"> 760 <?php 761 $new_screen_class = ''; 762 if ( $add_new_screen ) { 763 $new_screen_class = 'blank-slate'; 764 } 765 ?> 766 <div class="menu-edit <?php echo $new_screen_class; ?>"> 743 767 <input type="hidden" name="nav-menu-data"> 744 768 <?php … … 771 795 <?php if ( ! $add_new_screen ) : ?> 772 796 <h3><?php _e( 'Menu Structure' ); ?></h3> 773 <?php $starter_copy = ( $one_theme_location_no_menus ) ? __( 'Edit your default menu by adding or removing items. Drag each item into the order you prefer. Click Create Menu to save your changes.' ) : __( 'Drag each item into the order you prefer. Click the arrow on the right of the item to reveal additional configuration options.' ); ?> 774 <div class="drag-instructions post-body-plain" <?php if ( isset( $menu_items ) && 0 == count( $menu_items ) ) { ?>style="display: none;"<?php } ?>> 797 <?php 798 $hide_style = ''; 799 if ( isset( $menu_items ) && 0 == count( $menu_items ) ) { 800 $hide_style = 'style="display: none;"'; 801 } 802 $starter_copy = ( $one_theme_location_no_menus ) ? __( 'Edit your default menu by adding or removing items. Drag each item into the order you prefer. Click Create Menu to save your changes.' ) : __( 'Drag each item into the order you prefer. Click the arrow on the right of the item to reveal additional configuration options.' ); 803 ?> 804 <div class="drag-instructions post-body-plain" <?php echo $hide_style; ?>> 775 805 <p><?php echo $starter_copy; ?></p> 776 806 </div> … … 788 818 <input type="hidden" name="use-location" value="<?php echo esc_attr( $_GET['use-location'] ); ?>" /> 789 819 <?php endif; ?> 790 <?php endif; ?> 791 <div class="menu-settings" <?php if ( $one_theme_location_no_menus ) { ?>style="display: none;"<?php } ?>> 820 <?php 821 endif; 822 823 $no_menus_style = ''; 824 if ( $one_theme_location_no_menus ) { 825 $no_menus_style = 'style="display: none;"'; 826 } 827 ?> 828 <div class="menu-settings" <?php echo $no_menus_style; ?>> 792 829 <h3><?php _e( 'Menu Settings' ); ?></h3> 793 830 <?php
Note: See TracChangeset
for help on using the changeset viewer.