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
This commit is contained in:
Scott Taylor 2013-09-04 21:00:09 +00:00
parent bf6da40cfc
commit 6253183ffc

View File

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