diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index be110d1511..a974870fe3 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -3649,6 +3649,9 @@ function get_pages($args = '') { if ( !in_array( $post_type, $hierarchical_post_types ) ) return $pages; + if ( $parent > 0 && empty( $child_of ) && ! isset( $args['child_of'] ) ) + $hierarchical = false; + // Make sure we have a valid post status if ( !is_array( $post_status ) ) $post_status = explode( ',', $post_status );