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> |
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> |
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 --> |
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> |
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 --> |
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; |
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 | } |
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 ); |
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> |
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> |
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> |
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 --> |
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 --> |
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> |
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 --> |
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> |