get_pages filter-hookWP 2.1.0

Filters the retrieved list of pages.

Usage

add_filter( 'get_pages', 'wp_kama_get_pages_filter', 10, 2 );

/**
 * Function for `get_pages` filter-hook.
 * 
 * @param WP_Post[] $pages       Array of page objects.
 * @param array     $parsed_args Array of get_pages() arguments.
 *
 * @return WP_Post[]
 */
function wp_kama_get_pages_filter( $pages, $parsed_args ){

	// filter...
	return $pages;
}
$pages(WP_Post[])
Array of page objects.
$parsed_args(array)
Array of get_pages() arguments.

Changelog

Since 2.1.0 Introduced.

Where the hook is called

get_pages()
get_pages
wp-includes/post.php 6223
return apply_filters( 'get_pages', $pages, $parsed_args );
wp-includes/post.php 6009
$pages = apply_filters( 'get_pages', $pages, $parsed_args );
wp-includes/post.php 6170
$pages = apply_filters( 'get_pages', array(), $parsed_args );

Where the hook is used in WordPress

Usage not found.