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

Merges [25974] and [25975] to the 3.7 branch.

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

props chrisbliss18.
fixes #25750.

Built from https://develop.svn.wordpress.org/branches/3.7@25976


git-svn-id: http://core.svn.wordpress.org/branches/3.7@25919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-10-29 01:50:08 +00:00
parent 1171df59bc
commit 462ede7416
1 changed files with 1 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