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:
parent
bf6da40cfc
commit
6253183ffc
|
@ -3649,6 +3649,9 @@ function get_pages($args = '') {
|
||||||
if ( !in_array( $post_type, $hierarchical_post_types ) )
|
if ( !in_array( $post_type, $hierarchical_post_types ) )
|
||||||
return $pages;
|
return $pages;
|
||||||
|
|
||||||
|
if ( $parent > 0 && empty( $child_of ) && ! isset( $args['child_of'] ) )
|
||||||
|
$hierarchical = false;
|
||||||
|
|
||||||
// Make sure we have a valid post status
|
// Make sure we have a valid post status
|
||||||
if ( !is_array( $post_status ) )
|
if ( !is_array( $post_status ) )
|
||||||
$post_status = explode( ',', $post_status );
|
$post_status = explode( ',', $post_status );
|
||||||
|
|
Loading…
Reference in New Issue