Ticket #15459: 15459.2.diff
File 15459.2.diff, 4.9 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/class-wp-posts-list-table.php
diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 2453618..bd2261d 100644
a b class WP_Posts_List_Table extends WP_List_Table { 378 378 $count = 0; 379 379 $start = ( $pagenum - 1 ) * $per_page; 380 380 $end = $start + $per_page; 381 $to_display = array(); 381 382 382 383 foreach ( $pages as $page ) { 383 384 if ( $count >= $end ) 384 385 break; 385 386 386 387 if ( $count >= $start ) { 387 echo "\t"; 388 $this->single_row( $page, $level ); 388 $to_display[$page->ID] = $level; 389 389 } 390 390 391 391 $count++; 392 392 393 393 if ( isset( $children_pages ) ) 394 $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );394 $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display ); 395 395 } 396 396 397 397 // if it is the last pagenum and there are orphaned pages, display them with paging as well … … class WP_Posts_List_Table extends WP_List_Table { 402 402 break; 403 403 404 404 if ( $count >= $start ) { 405 echo "\t"; 406 $this->single_row( $op, 0 ); 405 $to_display[$op->ID] = 0; 407 406 } 408 407 409 408 $count++; 410 409 } 411 410 } 412 411 } 412 413 $ids = array_keys( $to_display ); 414 _prime_post_caches( $ids ); 415 416 if ( ! isset( $GLOBALS['post'] ) ) { 417 // touch_time() requires a global post set 418 $GLOBALS['post'] = array_shift( $ids ); 419 } 420 421 foreach ( $to_display as $page_id => $level ) { 422 echo "\t"; 423 $this->single_row( $page_id, $level ); 424 } 413 425 } 414 426 415 427 /** … … class WP_Posts_List_Table extends WP_List_Table { 424 436 * @param int $level 425 437 * @param int $pagenum 426 438 * @param int $per_page 439 * @param array $to_display list of pages to be displayed 427 440 */ 428 function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {441 function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page, &$to_display ) { 429 442 430 443 if ( ! isset( $children_pages[$parent] ) ) 431 444 return; … … class WP_Posts_List_Table extends WP_List_Table { 443 456 $my_parents = array(); 444 457 $my_parent = $page->post_parent; 445 458 while ( $my_parent ) { 446 $my_parent = get_post( $my_parent );459 $my_parent = get_post( $my_parent->ID ); 447 460 $my_parents[] = $my_parent; 448 461 if ( !$my_parent->post_parent ) 449 462 break; … … class WP_Posts_List_Table extends WP_List_Table { 451 464 } 452 465 $num_parents = count( $my_parents ); 453 466 while ( $my_parent = array_pop( $my_parents ) ) { 454 echo "\t"; 455 $this->single_row( $my_parent, $level - $num_parents ); 467 $to_display[$my_parent->ID] = $level - $num_parents; 456 468 $num_parents--; 457 469 } 458 470 } 459 471 460 472 if ( $count >= $start ) { 461 echo "\t"; 462 $this->single_row( $page, $level ); 473 $to_display[$page->ID] = $level; 463 474 } 464 475 465 476 $count++; 466 477 467 $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );478 $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display ); 468 479 } 469 480 470 481 unset( $children_pages[$parent] ); //required in order to keep track of orphans … … class WP_Posts_List_Table extends WP_List_Table { 475 486 static $alternate; 476 487 477 488 $global_post = get_post(); 489 490 if ( is_integer( $post ) ) { 491 $post = get_post( $post ); 492 } 493 478 494 $GLOBALS['post'] = $post; 479 495 setup_postdata( $post ); 480 496 -
src/wp-admin/includes/post.php
diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index 983e4e7..485e510 100644
a b function wp_edit_posts_query( $q = false ) { 899 899 $query['order'] = 'asc'; 900 900 $query['posts_per_page'] = -1; 901 901 $query['posts_per_archive_page'] = -1; 902 $query['fields'] = 'id=>parent'; 902 903 } 903 904 904 905 if ( ! empty( $q['show_sticky'] ) ) -
src/wp-includes/class-wp.php
diff --git a/src/wp-includes/class-wp.php b/src/wp-includes/class-wp.php index 2fe76fc..f6eb47c 100644
a b class WP { 25 25 * @since 2.0.0 26 26 * @var array 27 27 */ 28 var $private_query_vars = array( 'offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page', 'post__in', 'post__not_in', 'post_parent__in', 'post_parent__not_in' );28 var $private_query_vars = array( 'offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page', 'post__in', 'post__not_in', 'post_parent__in', 'post_parent__not_in', 'fields' ); 29 29 30 30 /** 31 31 * Extra query variables set by the user.