From 6253183ffc0c19a9e0aa222d01f85e15ffd63e14 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 4 Sep 2013 21:00:09 +0000 Subject: [PATCH] Set `hierarchical` to `false` when `parent` is passed to `get_pages()` and `child_of` is not. Fixes #25230. Built from https://develop.svn.wordpress.org/trunk@25245 git-svn-id: http://core.svn.wordpress.org/trunk@25213 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/post.php b/wp-includes/post.php index be110d1511..a974870fe3 100644 --- a/wp-includes/post.php +++ b/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 );