From 921fd015826a442dc58444f9f07d21def54f7e03 Mon Sep 17 00:00:00 2001 From: desrosj Date: Wed, 19 Dec 2018 22:23: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. Built from https://develop.svn.wordpress.org/trunk@44338 git-svn-id: http://core.svn.wordpress.org/trunk@44168 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index dec958cba2..acb43ef758 100644 --- a/wp-admin/includes/post.php +++ b/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; diff --git a/wp-includes/version.php b/wp-includes/version.php index 78c8c0a80e..ac7990d442 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-alpha-44336'; +$wp_version = '5.1-alpha-44338'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.