From ca5d99a7d721304b55889d4c110c25ccc48192e7 Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@14744 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 25c681276..733d6596f 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', );