From 47584c7bc0966c6e811513fc3ec1c182caf80fcd Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 19 Dec 2018 22:22:50 +0000 Subject: [PATCH] Posts, Post Types: Correctly show hierarchical post type hierarchy in admin. In [44185], a bug was introduced where hierarchical post types would not display in the correct default order (hierarchically). This was caused by a `! isset()` check, which returned `false` after [44185], causing the correct default value to not be applied. This switches that conditional to use an `empty()` check, ignoring the new empty string assignment that was added to prevent a PHP notice when `compact()` is called. Props davidbinda. Fixes #45711. git-svn-id: https://develop.svn.wordpress.org/trunk@44338 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index dec958cba2..acb43ef758 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -1157,7 +1157,7 @@ function wp_edit_posts_query( $q = false ) { $query = compact( 'post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page' ); // Hierarchical types require special args. - if ( is_post_type_hierarchical( $post_type ) && ! isset( $orderby ) ) { + if ( is_post_type_hierarchical( $post_type ) && empty( $orderby ) ) { $query['orderby'] = 'menu_order title'; $query['order'] = 'asc'; $query['posts_per_page'] = -1;