apply_filters( 'get_pages', WP_Post[] $pages, array $parsed_args )

Filters the retrieved list of pages.


Parameters

$pages WP_Post[]
Array of page objects.
$parsed_args array
Array of get_pages() arguments.
More Arguments from get_pages( ... $args ) Array or string of arguments to retrieve pages.
  • child_ofint
    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.
  • sort_orderstring
    How to sort retrieved pages. Accepts 'ASC', 'DESC'. Default 'ASC'.
  • sort_columnstring
    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'.
  • hierarchicalbool
    Whether to return pages hierarchically. If false in conjunction with $child_of also being false, both arguments will be disregarded.
    Default true.
  • excludeint[]
    Array of page IDs to exclude.
  • includeint[]
    Array of page IDs to include. Cannot be used with $child_of, $parent, $exclude, $meta_key, $meta_value, or $hierarchical.
  • meta_keystring
    Only include pages with this meta key.
  • meta_valuestring
    Only include pages with this meta value. Requires $meta_key.
  • authorsstring
    A comma-separated list of author IDs.
  • parentint
    Page ID to return direct children of. Default -1, or no restriction.
  • exclude_treestring|int[]
    Comma-separated string or array of page IDs to exclude.
  • numberint
    The number of pages to return. Default 0, or all pages.
  • offsetint
    The number of pages to skip before returning. Requires $number.
    Default 0.
  • post_typestring
    The post type to query. Default 'page'.
  • post_statusstring|array
    A comma-separated list or array of post statuses to include.
    Default 'publish'.

Top ↑

Source

File: wp-includes/post.php. View all references

return apply_filters( 'get_pages', $pages, $parsed_args );


Top ↑

Changelog

Changelog
Version Description
2.1.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.