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:
parent
1171df59bc
commit
462ede7416
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue