Make WordPress Core

Ticket #23450: 23450.2.diff

File 23450.2.diff, 30.6 KB (added by DrewAPicture, 10 years ago)

refresh

  • wp-admin/css/wp-admin.css

     
    70827082        display: block;
    70837083}
    70847084
     7085#nav-menu-meta ul.outer-border {
     7086        border: 1px solid #eeeeee;
     7087}
     7088
     7089.accordion-section ul.category-tabs,
     7090.accordion-section ul.add-menu-item-tabs,
     7091.accordion-section ul.wp-tab-bar {
     7092        margin: 0;
     7093}
     7094
     7095.accordion-section .categorychecklist {
     7096        margin: 13px 0;
     7097}
     7098
     7099#nav-menu-meta .accordion-section-content {
     7100        padding: 18px 13px;
     7101}
     7102
     7103#nav-menu-meta .button-controls {
     7104        margin-bottom: 0;
     7105}
     7106
    70857107#nav-menus-frame {
    70867108        margin-left: 300px;
    70877109        margin-top: 28px;
     
    72817303}
    72827304
    72837305/* Add Menu Item Boxes */
    7284 .postbox .howto input {
     7306.postbox .howto input,
     7307.accordion-container .howto input {
    72857308        width: 180px;
    72867309        float: right;
    72877310}
     
    72907313        width: 200px;
    72917314}
    72927315
     7316.customlinkdiv p {
     7317        margin-top: 0
     7318}
     7319
    72937320#nav-menu-theme-locations .howto select {
    72947321        width: 100%;
    72957322}
  • wp-admin/includes/nav-menu.php

     
    385385 * @since 3.0.0
    386386 **/
    387387function wp_nav_menu_setup() {
    388         // Register meta boxes
    389388        wp_nav_menu_post_type_meta_boxes();
    390         add_meta_box( 'add-custom-links', __( 'Add Links' ), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
     389        wp_nav_menu_item_link_meta_box();
    391390        wp_nav_menu_taxonomy_meta_boxes();
    392391
    393392        // Register advanced menu items (columns)
     
    447446                $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
    448447                if ( $post_type ) {
    449448                        $id = $post_type->name;
    450                         add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type );
     449                        wp_nav_menu_item_post_type_meta_box( $post_type );
    451450                }
    452451        }
    453452}
     
    467466                $tax = apply_filters( 'nav_menu_meta_box_object', $tax );
    468467                if ( $tax ) {
    469468                        $id = $tax->name;
    470                         add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax );
     469                        wp_nav_menu_item_taxonomy_meta_box( $tax );
    471470                }
    472471        }
    473472}
     
    564563        );
    565564
    566565        ?>
    567         <div class="customlinkdiv" id="customlinkdiv">
     566        <li class="control-section accordion-section" id="accordion-section-title_tagline">
     567                <h3 title="" tabindex="0" class="accordion-section-title"><?php _e('Links'); ?></h3>
     568                <div class="customlinkdiv accordion-section-content" id="customlinkdiv">
    568569
    569570                        <input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
    570571                        <p id="menu-item-url-wrap">
     
    581582                                </label>
    582583                        </p>
    583584
    584                 <p class="button-controls">
    585                         <span class="add-to-menu">
    586                                 <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-custom-menu-item" id="submit-customlinkdiv" />
    587                                 <span class="spinner"></span>
    588                         </span>
    589                 </p>
     585                        <p class="button-controls">
     586                                <span class="add-to-menu">
     587                                        <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-custom-menu-item" id="submit-customlinkdiv" />
     588                                        <span class="spinner"></span>
     589                                </span>
     590                        </p>
    590591
    591         </div><!-- /.customlinkdiv -->
     592                </div><!-- /.customlinkdiv -->
     593        </li>
    592594        <?php
    593595}
    594596
     
    600602 * @param string $object Not used.
    601603 * @param string $post_type The post type object.
    602604 */
    603 function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
     605function wp_nav_menu_item_post_type_meta_box( $post_type ) {
    604606        global $_nav_menu_placeholder, $nav_menu_selected_id;
    605607
    606         $post_type_name = $post_type['args']->name;
     608        $post_type_name = $post_type->name;
    607609
    608610        // paginate browsing for large numbers of post objects
    609611        $per_page = 50;
     
    621623                'update_post_meta_cache' => false
    622624        );
    623625
    624         if ( isset( $post_type['args']->_default_query ) )
    625                 $args = array_merge($args, (array) $post_type['args']->_default_query );
     626        if ( isset( $post_type->_default_query ) )
     627                $args = array_merge($args, (array) $post_type->_default_query );
    626628
    627629        // @todo transient caching of these results with proper invalidation on updating of a post of this type
    628630        $get_posts = new WP_Query;
     
    681683        );
    682684
    683685        ?>
    684         <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv">
    685                 <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
    686                         <li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'most-recent', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent"><?php _e('Most Recent'); ?></a></li>
    687                         <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#<?php echo $post_type_name; ?>-all"><?php _e('View All'); ?></a></li>
    688                         <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search"><?php _e('Search'); ?></a></li>
    689                 </ul>
     686        <li class="control-section accordion-section" id="accordion-section-title_tagline">
     687                <h3 title="" tabindex="0" class="accordion-section-title"><?php echo $post_type->labels->name; ?></h3>
     688                <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv accordion-section-content">
     689                        <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
     690                                <li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'most-recent', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent"><?php _e('Most Recent'); ?></a></li>
     691                                <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#<?php echo $post_type_name; ?>-all"><?php _e('View All'); ?></a></li>
     692                                <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search"><?php _e('Search'); ?></a></li>
     693                        </ul>
    690694
    691                 <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel <?php
    692                         echo ( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
    693                 ?>">
    694                         <ul id="<?php echo $post_type_name; ?>checklist-most-recent" class="categorychecklist form-no-clear">
    695                                 <?php
    696                                 $recent_args = array_merge( $args, array( 'orderby' => 'post_date', 'order' => 'DESC', 'posts_per_page' => 15 ) );
    697                                 $most_recent = $get_posts->query( $recent_args );
    698                                 $args['walker'] = $walker;
    699                                 echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $most_recent), 0, (object) $args );
    700                                 ?>
    701                         </ul>
    702                 </div><!-- /.tabs-panel -->
     695                        <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel <?php
     696                                echo ( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
     697                        ?>">
     698                                <ul id="<?php echo $post_type_name; ?>checklist-most-recent" class="categorychecklist form-no-clear">
     699                                        <?php
     700                                        $recent_args = array_merge( $args, array( 'orderby' => 'post_date', 'order' => 'DESC', 'posts_per_page' => 15 ) );
     701                                        $most_recent = $get_posts->query( $recent_args );
     702                                        $args['walker'] = $walker;
     703                                        echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $most_recent), 0, (object) $args );
     704                                        ?>
     705                                </ul>
     706                        </div><!-- /.tabs-panel -->
    703707
    704                 <div class="tabs-panel <?php
    705                         echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
    706                 ?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
    707                         <?php
    708                         if ( isset( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) {
    709                                 $searched = esc_attr( $_REQUEST['quick-search-posttype-' . $post_type_name] );
    710                                 $search_results = get_posts( array( 's' => $searched, 'post_type' => $post_type_name, 'fields' => 'all', 'order' => 'DESC', ) );
    711                         } else {
    712                                 $searched = '';
    713                                 $search_results = array();
    714                         }
    715                         ?>
    716                         <p class="quick-search-wrap">
    717                                 <input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" />
    718                                 <span class="spinner"></span>
    719                                 <?php submit_button( __( 'Search' ), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-posttype-' . $post_type_name ) ); ?>
    720                         </p>
     708                        <div class="tabs-panel <?php
     709                                echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
     710                        ?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
     711                                <?php
     712                                if ( isset( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) {
     713                                        $searched = esc_attr( $_REQUEST['quick-search-posttype-' . $post_type_name] );
     714                                        $search_results = get_posts( array( 's' => $searched, 'post_type' => $post_type_name, 'fields' => 'all', 'order' => 'DESC', ) );
     715                                } else {
     716                                        $searched = '';
     717                                        $search_results = array();
     718                                }
     719                                ?>
     720                                <p class="quick-search-wrap">
     721                                        <input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" />
     722                                        <span class="spinner"></span>
     723                                        <?php submit_button( __( 'Search' ), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-posttype-' . $post_type_name ) ); ?>
     724                                </p>
    721725
    722                         <ul id="<?php echo $post_type_name; ?>-search-checklist" data-wp-lists="list:<?php echo $post_type_name?>" class="categorychecklist form-no-clear">
    723                         <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
    724                                 <?php
    725                                 $args['walker'] = $walker;
    726                                 echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args );
    727                                 ?>
    728                         <?php elseif ( is_wp_error( $search_results ) ) : ?>
    729                                 <li><?php echo $search_results->get_error_message(); ?></li>
    730                         <?php elseif ( ! empty( $searched ) ) : ?>
    731                                 <li><?php _e('No results found.'); ?></li>
    732                         <?php endif; ?>
    733                         </ul>
    734                 </div><!-- /.tabs-panel -->
     726                                <ul id="<?php echo $post_type_name; ?>-search-checklist" data-wp-lists="list:<?php echo $post_type_name?>" class="categorychecklist form-no-clear">
     727                                <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
     728                                        <?php
     729                                        $args['walker'] = $walker;
     730                                        echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args );
     731                                        ?>
     732                                <?php elseif ( is_wp_error( $search_results ) ) : ?>
     733                                        <li><?php echo $search_results->get_error_message(); ?></li>
     734                                <?php elseif ( ! empty( $searched ) ) : ?>
     735                                        <li><?php _e('No results found.'); ?></li>
     736                                <?php endif; ?>
     737                                </ul>
     738                        </div><!-- /.tabs-panel -->
    735739
    736                 <div id="<?php echo $post_type_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php
    737                         echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
    738                 ?>">
    739                         <?php if ( ! empty( $page_links ) ) : ?>
    740                                 <div class="add-menu-item-pagelinks">
    741                                         <?php echo $page_links; ?>
    742                                 </div>
    743                         <?php endif; ?>
    744                         <ul id="<?php echo $post_type_name; ?>checklist" data-wp-lists="list:<?php echo $post_type_name?>" class="categorychecklist form-no-clear">
    745                                 <?php
    746                                 $args['walker'] = $walker;
     740                        <div id="<?php echo $post_type_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php
     741                                echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
     742                        ?>">
     743                                <?php if ( ! empty( $page_links ) ) : ?>
     744                                        <div class="add-menu-item-pagelinks">
     745                                                <?php echo $page_links; ?>
     746                                        </div>
     747                                <?php endif; ?>
     748                                <ul id="<?php echo $post_type_name; ?>checklist" data-wp-lists="list:<?php echo $post_type_name?>" class="categorychecklist form-no-clear">
     749                                        <?php
     750                                        $args['walker'] = $walker;
    747751
    748                                 // if we're dealing with pages, let's put a checkbox for the front page at the top of the list
    749                                 if ( 'page' == $post_type_name ) {
    750                                         $front_page = 'page' == get_option('show_on_front') ? (int) get_option( 'page_on_front' ) : 0;
    751                                         if ( ! empty( $front_page ) ) {
    752                                                 $front_page_obj = get_post( $front_page );
    753                                                 $front_page_obj->front_or_home = true;
    754                                                 array_unshift( $posts, $front_page_obj );
    755                                         } else {
    756                                                 $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
    757                                                 array_unshift( $posts, (object) array(
    758                                                         'front_or_home' => true,
    759                                                         'ID' => 0,
    760                                                         'object_id' => $_nav_menu_placeholder,
    761                                                         'post_content' => '',
    762                                                         'post_excerpt' => '',
    763                                                         'post_parent' => '',
    764                                                         'post_title' => _x('Home', 'nav menu home label'),
    765                                                         'post_type' => 'nav_menu_item',
    766                                                         'type' => 'custom',
    767                                                         'url' => home_url('/'),
    768                                                 ) );
     752                                        // if we're dealing with pages, let's put a checkbox for the front page at the top of the list
     753                                        if ( 'page' == $post_type_name ) {
     754                                                $front_page = 'page' == get_option('show_on_front') ? (int) get_option( 'page_on_front' ) : 0;
     755                                                if ( ! empty( $front_page ) ) {
     756                                                        $front_page_obj = get_post( $front_page );
     757                                                        $front_page_obj->front_or_home = true;
     758                                                        array_unshift( $posts, $front_page_obj );
     759                                                } else {
     760                                                        $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
     761                                                        array_unshift( $posts, (object) array(
     762                                                                'front_or_home' => true,
     763                                                                'ID' => 0,
     764                                                                'object_id' => $_nav_menu_placeholder,
     765                                                                'post_content' => '',
     766                                                                'post_excerpt' => '',
     767                                                                'post_parent' => '',
     768                                                                'post_title' => _x('Home', 'nav menu home label'),
     769                                                                'post_type' => 'nav_menu_item',
     770                                                                'type' => 'custom',
     771                                                                'url' => home_url('/'),
     772                                                        ) );
     773                                                }
    769774                                        }
    770                                 }
    771775
    772                                 $posts = apply_filters( 'nav_menu_items_'.$post_type_name, $posts, $args, $post_type );
    773                                 $checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args );
     776                                        $posts = apply_filters( 'nav_menu_items_'.$post_type_name, $posts, $args, $post_type );
     777                                        $checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args );
    774778
    775                                 if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) {
    776                                         $checkbox_items = preg_replace('/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items);
     779                                        if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) )
     780                                                $checkbox_items = preg_replace('/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items);
    777781
    778                                 }
     782                                        echo $checkbox_items;
     783                                        ?>
     784                                </ul>
     785                                <?php if ( ! empty( $page_links ) ) : ?>
     786                                        <div class="add-menu-item-pagelinks">
     787                                                <?php echo $page_links; ?>
     788                                        </div>
     789                                <?php endif; ?>
     790                        </div><!-- /.tabs-panel -->
    779791
    780                                 echo $checkbox_items;
    781                                 ?>
    782                         </ul>
    783                         <?php if ( ! empty( $page_links ) ) : ?>
    784                                 <div class="add-menu-item-pagelinks">
    785                                         <?php echo $page_links; ?>
    786                                 </div>
    787                         <?php endif; ?>
    788                 </div><!-- /.tabs-panel -->
     792                        <p class="button-controls">
     793                                <span class="list-controls">
     794                                        <a href="<?php
     795                                                echo esc_url(add_query_arg(
     796                                                        array(
     797                                                                $post_type_name . '-tab' => 'all',
     798                                                                'selectall' => 1,
     799                                                        ),
     800                                                        remove_query_arg($removed_args)
     801                                                ));
     802                                        ?>#posttype-<?php echo $post_type_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
     803                                </span>
    789804
    790                 <p class="button-controls">
    791                         <span class="list-controls">
    792                                 <a href="<?php
    793                                         echo esc_url( add_query_arg(
    794                                                 array(
    795                                                         $post_type_name . '-tab' => 'all',
    796                                                         'selectall' => 1,
    797                                                 ),
    798                                                 remove_query_arg( $removed_args )
    799                                         ));
    800                                 ?>#posttype-<?php echo $post_type_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
    801                         </span>
     805                                <span class="add-to-menu">
     806                                        <input type="submit"<?php disabled( $nav_menu_selected_id, 0 ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-post-type-menu-item" id="submit-posttype-<?php echo $post_type_name; ?>" />
     807                                        <span class="spinner"></span>
     808                                </span>
     809                        </p>
    802810
    803                         <span class="add-to-menu">
    804                                 <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( __( 'Add to Menu' ) ); ?>" name="add-post-type-menu-item" id="<?php esc_attr_e( 'submit-posttype-' . $post_type_name ); ?>" />
    805                                 <span class="spinner"></span>
    806                         </span>
    807                 </p>
    808 
    809         </div><!-- /.posttypediv -->
     811                </div><!-- /.posttypediv -->
     812        </li>
    810813        <?php
    811814}
    812815
     
    818821 * @param string $object Not used.
    819822 * @param string $taxonomy The taxonomy object.
    820823 */
    821 function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
     824function wp_nav_menu_item_taxonomy_meta_box( $taxonomy ) {
    822825        global $nav_menu_selected_id;
    823         $taxonomy_name = $taxonomy['args']->name;
     826        $taxonomy_name = $taxonomy->name;
    824827
    825828        // paginate browsing for large numbers of objects
    826829        $per_page = 50;
     
    842845
    843846        $terms = get_terms( $taxonomy_name, $args );
    844847
    845         if ( ! $terms || is_wp_error($terms) ) {
     848        if ( is_wp_error($terms) ) {
    846849                echo '<p>' . __( 'No items.' ) . '</p>';
    847850                return;
    848851        }
     
    891894        );
    892895
    893896        ?>
    894         <div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv">
    895                 <ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
    896                         <li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop"><?php _e('Most Used'); ?></a></li>
    897                         <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all"><?php _e('View All'); ?></a></li>
    898                         <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>"><?php _e('Search'); ?></a></li>
    899                 </ul>
     897        <li class="control-section accordion-section" id="accordion-section-title_tagline">
     898                <h3 title="" tabindex="0" class="accordion-section-title"><?php echo $taxonomy->labels->name; ?></h3>
     899                <div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv accordion-section-content">
     900                        <ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
     901                                <li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop"><?php _e('Most Used'); ?></a></li>
     902                                <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all"><?php _e('View All'); ?></a></li>
     903                                <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>"><?php _e('Search'); ?></a></li>
     904                        </ul>
    900905
    901                 <div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php
    902                         echo ( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
    903                 ?>">
    904                         <ul id="<?php echo $taxonomy_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
    905                                 <?php
    906                                 $popular_terms = get_terms( $taxonomy_name, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
    907                                 $args['walker'] = $walker;
    908                                 echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $popular_terms), 0, (object) $args );
    909                                 ?>
    910                         </ul>
    911                 </div><!-- /.tabs-panel -->
     906                        <div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php
     907                                echo ( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
     908                        ?>">
     909                                <ul id="<?php echo $taxonomy_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
     910                                        <?php
     911                                        $popular_terms = get_terms( $taxonomy_name, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
     912                                        $args['walker'] = $walker;
     913                                        echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $popular_terms), 0, (object) $args );
     914                                        ?>
     915                                </ul>
     916                        </div><!-- /.tabs-panel -->
    912917
    913                 <div id="tabs-panel-<?php echo $taxonomy_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php
    914                         echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
    915                 ?>">
    916                         <?php if ( ! empty( $page_links ) ) : ?>
    917                                 <div class="add-menu-item-pagelinks">
    918                                         <?php echo $page_links; ?>
    919                                 </div>
    920                         <?php endif; ?>
    921                         <ul id="<?php echo $taxonomy_name; ?>checklist" data-wp-lists="list:<?php echo $taxonomy_name?>" class="categorychecklist form-no-clear">
    922                                 <?php
    923                                 $args['walker'] = $walker;
    924                                 echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $terms), 0, (object) $args );
    925                                 ?>
    926                         </ul>
    927                         <?php if ( ! empty( $page_links ) ) : ?>
    928                                 <div class="add-menu-item-pagelinks">
    929                                         <?php echo $page_links; ?>
    930                                 </div>
    931                         <?php endif; ?>
    932                 </div><!-- /.tabs-panel -->
     918                        <div id="tabs-panel-<?php echo $taxonomy_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php
     919                                echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
     920                        ?>">
     921                                <?php if ( ! empty( $page_links ) ) : ?>
     922                                        <div class="add-menu-item-pagelinks">
     923                                                <?php echo $page_links; ?>
     924                                        </div>
     925                                <?php endif; ?>
     926                                <ul id="<?php echo $taxonomy_name; ?>checklist" data-wp-lists="list:<?php echo $taxonomy_name?>" class="categorychecklist form-no-clear">
     927                                        <?php
     928                                        $args['walker'] = $walker;
     929                                        echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $terms), 0, (object) $args );
     930                                        ?>
     931                                </ul>
     932                                <?php if ( ! empty( $page_links ) ) : ?>
     933                                        <div class="add-menu-item-pagelinks">
     934                                                <?php echo $page_links; ?>
     935                                        </div>
     936                                <?php endif; ?>
     937                        </div><!-- /.tabs-panel -->
    933938
    934                 <div class="tabs-panel <?php
    935                         echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
    936                 ?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
    937                         <?php
    938                         if ( isset( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ) ) {
    939                                 $searched = esc_attr( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] );
    940                                 $search_results = get_terms( $taxonomy_name, array( 'name__like' => $searched, 'fields' => 'all', 'orderby' => 'count', 'order' => 'DESC', 'hierarchical' => false ) );
    941                         } else {
    942                                 $searched = '';
    943                                 $search_results = array();
    944                         }
    945                         ?>
    946                         <p class="quick-search-wrap">
    947                                 <input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" />
    948                                 <span class="spinner"></span>
    949                                 <?php submit_button( __( 'Search' ), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-taxonomy-' . $taxonomy_name ) ); ?>
    950                         </p>
     939                        <div class="tabs-panel <?php
     940                                echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
     941                        ?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
     942                                <?php
     943                                if ( isset( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ) ) {
     944                                        $searched = esc_attr( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] );
     945                                        $search_results = get_terms( $taxonomy_name, array( 'name__like' => $searched, 'fields' => 'all', 'orderby' => 'count', 'order' => 'DESC', 'hierarchical' => false ) );
     946                                } else {
     947                                        $searched = '';
     948                                        $search_results = array();
     949                                }
     950                                ?>
     951                                <p class="quick-search-wrap">
     952                                        <input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" />
     953                                        <span class="spinner"></span>
     954                                        <?php submit_button( __( 'Search' ), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-taxonomy-' . $taxonomy_name ) ); ?>
     955                                </p>
    951956
    952                         <ul id="<?php echo $taxonomy_name; ?>-search-checklist" data-wp-lists="list:<?php echo $taxonomy_name?>" class="categorychecklist form-no-clear">
    953                         <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
    954                                 <?php
    955                                 $args['walker'] = $walker;
    956                                 echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args );
    957                                 ?>
    958                         <?php elseif ( is_wp_error( $search_results ) ) : ?>
    959                                 <li><?php echo $search_results->get_error_message(); ?></li>
    960                         <?php elseif ( ! empty( $searched ) ) : ?>
    961                                 <li><?php _e('No results found.'); ?></li>
    962                         <?php endif; ?>
    963                         </ul>
    964                 </div><!-- /.tabs-panel -->
     957                                <ul id="<?php echo $taxonomy_name; ?>-search-checklist" data-wp-lists="list:<?php echo $taxonomy_name?>" class="categorychecklist form-no-clear">
     958                                <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
     959                                        <?php
     960                                        $args['walker'] = $walker;
     961                                        echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args );
     962                                        ?>
     963                                <?php elseif ( is_wp_error( $search_results ) ) : ?>
     964                                        <li><?php echo $search_results->get_error_message(); ?></li>
     965                                <?php elseif ( ! empty( $searched ) ) : ?>
     966                                        <li><?php _e('No results found.'); ?></li>
     967                                <?php endif; ?>
     968                                </ul>
     969                        </div><!-- /.tabs-panel -->
    965970
    966                 <p class="button-controls">
    967                         <span class="list-controls">
    968                                 <a href="<?php
    969                                         echo esc_url(add_query_arg(
    970                                                 array(
    971                                                         $taxonomy_name . '-tab' => 'all',
    972                                                         'selectall' => 1,
    973                                                 ),
    974                                                 remove_query_arg($removed_args)
    975                                         ));
    976                                 ?>#taxonomy-<?php echo $taxonomy_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
    977                         </span>
    978 
    979                         <span class="add-to-menu">
    980                                 <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( __( 'Add to Menu' ) ); ?>" name="add-taxonomy-menu-item" id="<?php esc_attr_e( 'submit-taxonomy-' . $taxonomy_name ); ?>" />
    981                                 <span class="spinner"></span>
    982                         </span>
    983                 </p>
    984 
    985         </div><!-- /.taxonomydiv -->
     971                        <p class="button-controls">
     972                                <span class="list-controls">
     973                                        <a href="<?php
     974                                                echo esc_url(add_query_arg(
     975                                                        array(
     976                                                                $taxonomy_name . '-tab' => 'all',
     977                                                                'selectall' => 1,
     978                                                        ),
     979                                                        remove_query_arg($removed_args)
     980                                                ));
     981                                        ?>#taxonomy-<?php echo $taxonomy_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
     982                                </span>
     983                                <span class="add-to-menu">
     984                                        <input type="submit"<?php disabled( $nav_menu_selected_id, 0 ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-taxonomy-menu-item" id="submit-taxonomy-<?php echo $taxonomy_name; ?>" />
     985                                        <span class="spinner"></span>
     986                                </span>
     987                        </p>
     988                </div><!-- /.taxonomydiv -->
     989        </li>
    986990        <?php
    987991}
    988992
  • wp-admin/js/nav-menu.js

     
    5151                        this.messageFadeIn();
    5252
    5353                        this.initAccessibility();
    54 
    55                         this.initToggles();
    5654                },
    5755
    5856                jQueryExtensions : function() {
     
    386384                        messages.slideDown( 'slow' );
    387385                },
    388386
    389                 initToggles : function() {
    390                         // init postboxes
    391                         postboxes.add_postbox_toggles('nav-menus');
    392 
    393                         // adjust columns functions for menus UI
    394                         columns.useCheckboxesForHidden();
    395                         columns.checked = function(field) {
    396                                 $('.field-' + field).removeClass('hidden-field');
    397                         }
    398                         columns.unchecked = function(field) {
    399                                 $('.field-' + field).addClass('hidden-field');
    400                         }
    401                         // hide fields
    402                         api.menuList.hideAdvancedMenuItemFields();
    403                 },
    404 
    405387                initSortables : function() {
    406388                        var currentDepth = 0, originalDepth, minDepth, maxDepth,
    407389                                prev, next, prevBottom, nextThreshold, helperHeight, transport,
  • wp-admin/nav-menus.php

     
    2323        wp_die( __( 'Cheatin&#8217; uh?' ) );
    2424
    2525wp_enqueue_script( 'nav-menu' );
     26wp_enqueue_script( 'accordion' );
    2627
    2728if ( wp_is_mobile() )
    2829        wp_enqueue_script( 'jquery-touch-punch' );
     
    423424
    424425add_filter('admin_body_class', 'wp_nav_menu_max_depth');
    425426
    426 wp_nav_menu_setup();
    427427wp_initial_nav_menu_meta_boxes();
    428428
    429429if ( ! current_theme_supports( 'menus' ) && ! wp_get_nav_menus() )
     
    505505                        <input type="hidden" name="menu" id="nav-menu-meta-object-id" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
    506506                        <input type="hidden" name="action" value="add-menu-item" />
    507507                        <?php wp_nonce_field( 'add-menu_item', 'menu-settings-column-nonce' ); ?>
    508                         <?php do_meta_boxes( 'nav-menus', 'side', null ); ?>
     508                        <div id="side-sortables" class="accordion-container">
     509                                <ul class="outer-border">
     510                                        <?php wp_nav_menu_setup(); ?>
     511                                </ul>
     512                        </div>
    509513                </form>
    510514
    511515        </div><!-- /#menu-settings-column -->