From e25c7e19356de0fe15a9f9a3d7d2e3e732a08873 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 19 May 2010 14:34:29 +0000 Subject: [PATCH] Order pages in menu box by menu_order, title. Props filosofo. see #13329 git-svn-id: https://develop.svn.wordpress.org/trunk@14744 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/nav-menu.php | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index 25c6812765..733d6596ff 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -537,32 +537,6 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) { $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( @@ -936,8 +910,7 @@ function _wp_nav_menu_meta_box_object( $object = null ) { // pages should show most recent if ( 'page' == $object->name ) { $object->_default_query = array( - 'orderby' => 'post_date', - 'order' => 'DESC', + 'orderby' => 'menu_order title', 'post_status' => 'publish', );