From 91afce3ea8f4e456bb8b3f5926dcedec25f3c3bc Mon Sep 17 00:00:00 2001 From: desrosj Date: Wed, 19 Dec 2018 22:28:45 +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. Merges [44338] to the 5.0 branch. Props davidbinda. Fixes #45711. Built from https://develop.svn.wordpress.org/branches/5.0@44339 git-svn-id: http://core.svn.wordpress.org/branches/5.0@44169 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 a2bbd8753e..785dcf933f 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1086,7 +1086,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 a300b90293..63741caa4e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0.2-RC2-44337'; +$wp_version = '5.0.2-RC2-44339'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.