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
This commit is contained in:
parent
9992044ce6
commit
921fd01582
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue