Avoid resetting the 'hierarchical' argument in get_pages() when 'parent' is -1, the default.

Fixes a regression introduced in [25270]. Adds unit tests.

props chrisbliss18.
fixes #25750.


git-svn-id: https://develop.svn.wordpress.org/trunk@25974 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2013-10-29 01:46:01 +00:00
parent 4be9031dc3
commit 2cac0fde8a
2 changed files with 31 additions and 1 deletions

View File

@@ -3706,7 +3706,7 @@ function get_pages( $args = array() ) {
if ( !in_array( $post_type, $hierarchical_post_types ) )
return $pages;
if ( $parent && ! $child_of )
if ( $parent > 0 && ! $child_of )
$hierarchical = false;
// Make sure we have a valid post status