Make WordPress Core

Changeset 44338


Ignore:
Timestamp:
12/19/2018 10:22:50 PM (4 years ago)
Author:
desrosj
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r44315 r44338  
    11581158
    11591159    // Hierarchical types require special args.
    1160     if ( is_post_type_hierarchical( $post_type ) && ! isset( $orderby ) ) {
     1160    if ( is_post_type_hierarchical( $post_type ) && empty( $orderby ) ) {
    11611161        $query['orderby']                = 'menu_order title';
    11621162        $query['order']                  = 'asc';
Note: See TracChangeset for help on using the changeset viewer.