ID ); $removed_args = array( 'action', 'customlink-tab', 'edit-menu-item', 'menu-item', 'page-tab', '_wpnonce', ); $original_title = ''; if ( 'taxonomy' == $item->type ) { $original_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' ); } elseif ( 'post_type' == $item->type ) { $original_object = get_post( $item->object_id ); $original_title = $original_object->post_title; } ?>
$_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1; // @note: hacky query, see #12660 $args = array( 'post_type' => 'nav_menu_item', 'post_status' => 'any', 'meta_key' => '_menu_item_type', 'numberposts' => -1, 'orderby' => 'title', ); // @todo transient caching of these results with proper invalidation on updating links $links = get_posts( $args ); $current_tab = 'create'; if ( isset( $_REQUEST['customlink-tab'] ) && in_array( $_REQUEST['customlink-tab'], array('create', 'all') ) ) { $current_tab = $_REQUEST['customlink-tab']; } $removed_args = array( 'action', 'customlink-tab', 'edit-menu-item', 'menu-item', 'page-tab', '_wpnonce', ); ?>
' . __( 'No items.' ) . '
'; return; } $post_type_object = get_post_type_object($post_type_name); $num_pages = $get_posts->max_num_pages; if ( isset( $get_posts->found_posts ) && ( $get_posts->found_posts > $get_posts->post_count ) ) { // somewhat like display_page_row(), let's make sure ancestors show up on paged display $parent_ids = array(); $child_ids = array(); foreach( (array) $posts as $post ) { $parent_ids[] = (int) $post->post_parent; $child_ids[] = (int) $post->ID; } $parent_ids = array_unique($parent_ids); $child_ids = array_unique($child_ids); $missing_parents = array(); do { foreach( (array) $missing_parents as $missing_parent_id ) { $missing_parent = get_post($missing_parent_id); $posts[] = $missing_parent; $child_ids[] = $missing_parent_id; $parent_ids[] = $missing_parent->post_parent; } $missing_parents = array_filter( array_diff( array_unique( $parent_ids ), array_unique( $child_ids ) ) ); } while( 0 < count( $missing_parents ) ); } $page_links = paginate_links( array( 'base' => add_query_arg( array( $post_type_name . '-tab' => 'all', 'paged' => '%#%', ) ), 'format' => '', 'prev_text' => __('«'), 'next_text' => __('»'), 'total' => $num_pages, 'current' => $pagenum )); if ( !$posts ) $error = '
' . __( 'No items.' ) . '
'; return; } $num_pages = ceil( count($terms) / $per_page ); $page_links = paginate_links( array( 'base' => add_query_arg( array( $taxonomy_name . '-tab' => 'all', 'paged' => '%#%', ) ), 'format' => '', 'prev_text' => __('«'), 'next_text' => __('»'), 'total' => $num_pages, 'current' => $pagenum )); $walker = new Walker_Nav_Menu_Checklist; $current_tab = 'most-used'; if ( isset( $_REQUEST[$taxonomy_name . '-tab'] ) && in_array( $_REQUEST[$taxonomy_name . '-tab'], array('all', 'most-used', 'search') ) ) { $current_tab = $_REQUEST[$taxonomy_name . '-tab']; } if ( ! empty( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ) ) { $current_tab = 'search'; } $removed_args = array( 'action', 'customlink-tab', 'edit-menu-item', 'menu-item', 'page-tab', '_wpnonce', ); ?>