diff --git wp-admin/includes/class-wp-posts-list-table.php wp-admin/includes/class-wp-posts-list-table.php
index 9d509bb..0934b26 100644
|
|
|
class WP_Posts_List_Table extends WP_List_Table { |
| 363 | 363 | clean_post_cache( $page ); |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | | if ( 0 == $page->post_parent ) |
| 367 | | $top_level_pages[] = $page; |
| | 366 | if ( 0 == $page->post_parent || !$this->is_post_in_array( $page->post_parent, $pages )) |
| | 367 | $top_level_pages[] = $page; |
| 368 | 368 | else |
| 369 | | $children_pages[ $page->post_parent ][] = $page; |
| | 369 | $children_pages[ $page->post_parent ][] = $page; |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | $pages = &$top_level_pages; |
| … |
… |
class WP_Posts_List_Table extends WP_List_Table { |
| 514 | 514 | if ( is_null( $parent ) ) |
| 515 | 515 | break; |
| 516 | 516 | |
| 517 | | $level++; |
| 518 | 517 | $find_main_page = (int) $parent->post_parent; |
| 519 | 518 | |
| 520 | | if ( !isset( $parent_name ) ) |
| | 519 | if ( !isset( $parent_name ) && $parent->post_status != 'trash' ) |
| 521 | 520 | $parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID ); |
| 522 | 521 | } |
| 523 | 522 | } |
| … |
… |
class WP_Posts_List_Table extends WP_List_Table { |
| 1060 | 1059 | </tbody></table></form> |
| 1061 | 1060 | <?php |
| 1062 | 1061 | } |
| | 1062 | |
| | 1063 | /** |
| | 1064 | * Determine if a post object with certain ID exists in an array of post objects |
| | 1065 | * |
| | 1066 | * @return bool |
| | 1067 | */ |
| | 1068 | function is_post_in_array( $post_id, $posts ) { |
| | 1069 | foreach ( $posts as $post ) { |
| | 1070 | if ( $post->ID == $post_id ) { |
| | 1071 | return true; |
| | 1072 | } |
| | 1073 | } |
| | 1074 | return false; |
| | 1075 | } |
| 1063 | 1076 | } |