| @@ -89,12 +89,21 @@ | ||
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // Hierarchical post types |
| 93 | - if ( 'edit' == $screen->base && is_post_type_hierarchical( $screen->post_type ) ) { | |
| 94 | - $pages = get_pages( array( 'sort_column' => 'menu_order, post_title' ) ); // Same arguments as the parent pages dropdown to avoid an extra query. | |
| 93 | + if ( 'edit' == $screen->base && is_post_type_hierarchical( $screen->post_type ) && post_type_supports( $screen->post_type, 'page-attributes' ) ) { | |
| 94 | + $pages = get_pages( | |
| 95 | + array( | |
| 96 | + 'sort_column' => 'menu_order, post_title', | |
| 97 | + 'post_type' => $screen->post_type, | |
| 98 | + ) | |
| 99 | + ); // Same arguments as the parent pages dropdown to avoid an extra query. | |
| 95 | 100 | |
| 96 | - update_post_caches( $pages, $screen->post_type, true, false ); | |
| 101 | + if ( ! is_array( $pages ) ) { | |
| 102 | + return; | |
| 103 | + } | |
| 104 | + | |
| 105 | + update_object_term_cache( wp_list_pluck( $pages, 'ID' ), $screen->post_type ); | |
| 97 | 106 | |
| 98 | 107 | $page_languages = array(); |
| 99 | 108 | |
| 100 | 109 | foreach ( $pages as $page ) { |