More adjustments and improvements for inline documentation for get_pages(). see #25186.

git-svn-id: https://develop.svn.wordpress.org/trunk@25271 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-09-06 01:20:17 +00:00
parent bd610dd68a
commit 760d5825ad
1 changed files with 29 additions and 18 deletions

View File

@ -3615,32 +3615,43 @@ function get_page_uri( $page ) {
} }
/** /**
* Retrieve a list of pages * Retrieve a list of pages.
* *
* @global wpdb $wpdb WordPress database abstraction object * @global wpdb $wpdb WordPress database abstraction object
* *
* @since 1.5.0 * @since 1.5.0
* *
* @param mixed $args (optional) Array or string of arguments { * @param mixed $args {
* @type int 'child_of' Page ID to return child and grandchild pages of (default 0). * Array or string of arguments. Optional.
* @type string 'sort_order' How to sort retrieved pages (default 'ASC', accepts 'ASC', 'DESC'). *
* @type string 'sort_column' What column to sort pages by (default 'post_title', accepts post fields). * @type int 'child_of' Page ID to return child and grandchild pages of. Default 0, or no restriction.
* @type bool 'hierarchical' Whether to return pages hierarchically (default 1|true). * @type string 'sort_order' How to sort retrieved pages.
* @type array 'exclude' Array of page IDs to exclude (default array). * Default 'ASC'. Accepts 'ASC', 'DESC'.
* @type array 'include' Array of page IDs to include (default array). * @type string 'sort_column' What columns to sort pages by, comma-separated.
* @type string 'meta_key' Only include pages with this meta key (default empty). * Default 'post_title'. Accepts 'post_author', 'post_date', 'post_title', 'post_name',
* @type string 'meta_value' Only include pages with this meta value (default empty). * 'post_modified', 'post_modified_gmt', 'menu_order', 'post_parent', 'ID', 'rand',
* @type string 'authors' A comma-separated list of author IDs (default empty). * 'comment_count'. 'post_' can be omitted for any values that start with it.
* @type int 'parent' Page ID to return direct children of. 'hierarchical' must be 0|false (default -1). * @type bool 'hierarchical' Whether to return pages hierarchically. Default true.
* @type int 'exclude_tree' Remove all children of given ID from returned pages (default empty). * @type array 'exclude' Array of page IDs to exclude.
* @type int 'number' The number of pages to return (default empty). * @type array 'include' Array of page IDs to include. Cannot be used with 'child_of', 'parent', 'exclude',
* @type int 'offset' The number of pages to skip before returning (default 0). * 'meta_key', 'meta_value', or 'hierarchical'.
* @type string 'post_type' The post type to return (default 'page'). * @type string 'meta_key' Only include pages with this meta key.
* @type string 'post_status' A comma-separated list of post status types to include (default 'publish'). * @type string 'meta_value' Only include pages with this meta value.
* @type string 'authors' A comma-separated list of author IDs.
* @type int 'parent' Page ID to return direct children of. 'hierarchical' must be false.
* Default -1, or no restriction.
* @type int 'exclude_tree' Remove all children of the given ID from returned pages.
* @type int 'number' The number of pages to return. Default 0, or all pages.
* @type int 'offset' The number of pages to skip before returning. Requires 'number'.
* Default 0.
* @type string 'post_type' The post type to query.
* Default 'page'.
* @type string 'post_status' A comma-separated list of post status types to include.
* Default 'publish'.
* } * }
* @return array List of pages matching defaults or $args. * @return array List of pages matching defaults or $args.
*/ */
function get_pages( $args = '' ) { function get_pages( $args = array() ) {
global $wpdb; global $wpdb;
$pages = false; $pages = false;