From 411f09b8115b760382a34d90c13b727b2d22581f Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 11 May 2010 18:38:51 +0000 Subject: [PATCH] No need to recount. see #12734 git-svn-id: https://develop.svn.wordpress.org/trunk@14567 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/nav-menu.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index a2960c966c..635371f42a 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -492,8 +492,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) { // @todo transient caching of these results with proper invalidation on updating of a post of this type $get_posts = new WP_Query; $posts = $get_posts->query( $args ); - $count_posts = (int) @count( $posts ); - if ( ! $count_posts ) { + if ( ! $get_posts->post_count ) { echo '

' . __( 'No items.' ) . '

'; return; } @@ -502,7 +501,7 @@ 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 > $count_posts ) ) { + 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();