PluginProbe
Polylang / 3.8.10
Polylang v3.8.10
3.8.10 3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 All 234 releases
← All changes | src/admin/admin-filters-post.php +12 -3 3.8.4 → 3.8.10 View file →
@@ -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 ) {