From 08f047176b5f945535a48cdc15ca3eb995ef82b5 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Thu, 1 Oct 2015 17:39:25 +0000 Subject: [PATCH] Docs: Update the argument descriptions for `$child_of` and `$hierarchical` in `get_pages()` to more closely reflect expected behavior. See #18701. See #32246. git-svn-id: https://develop.svn.wordpress.org/trunk@34746 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post-functions.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/post-functions.php b/src/wp-includes/post-functions.php index b787e143d5..10e6be4e21 100644 --- a/src/wp-includes/post-functions.php +++ b/src/wp-includes/post-functions.php @@ -4280,15 +4280,18 @@ function get_page_uri( $page ) { * @param array|string $args { * Optional. Array or string of arguments to retrieve pages. * - * @type int $child_of Page ID to return child and grandchild pages of. - * Default 0, or no restriction. + * @type int $child_of Page ID to return child and grandchild pages of. Note: The value + * of `$hierarchical` has no bearing on whether `$child_of` returns + * hierarchical results. Default 0, or no restriction. * @type string $sort_order How to sort retrieved pages. Accepts 'ASC', 'DESC'. Default 'ASC'. * @type string $sort_column What columns to sort pages by, comma-separated. Accepts 'post_author', * 'post_date', 'post_title', 'post_name', 'post_modified', 'menu_order', * 'post_modified_gmt', 'post_parent', 'ID', 'rand', 'comment_count'. * 'post_' can be omitted for any values that start with it. * Default 'post_title'. - * @type bool $hierarchical Whether to return pages hierarchically. Default true. + * @type bool $hierarchical Whether to return pages hierarchically. If false in conjunction with + * `$child_of` also being false, both arguments will be disregarded. + * Default true. * @type array $exclude Array of page IDs to exclude. Default empty array. * @type array $include Array of page IDs to include. Cannot be used with `$child_of`, * `$parent`, `$exclude`, `$meta_key`, `$meta_value`, or `$hierarchical`. @@ -4297,8 +4300,7 @@ function get_page_uri( $page ) { * @type string $meta_value Only include pages with this meta value. Requires `$meta_key`. * Default empty. * @type string $authors A comma-separated list of author IDs. Default empty. - * @type int $parent Page ID to return direct children of. `$hierarchical` must be false. - * Default -1, or no restriction. + * @type int $parent Page ID to return direct children of. Default -1, or no restriction. * @type string|array $exclude_tree Comma-separated string or array of page IDs to exclude. * Default empty array. * @type int $number The number of pages to return. Default 0, or all pages.