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
This commit is contained in:
desrosj 2018-12-19 22:28:45 +00:00
parent ce30819c90
commit 91afce3ea8
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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.