wp_list_pages
Filters the HTML output of the pages to list.
Использование
add_filter( 'wp_list_pages', 'wp_kama_list_pages_filter', 10, 3 );
/**
* Function for `wp_list_pages` filter-hook.
*
* @param string $output HTML output of the pages list.
* @param array $parsed_args An array of page-listing arguments. See wp_list_pages() for information on accepted arguments.
* @param WP_Post[] $pages Array of the page objects.
*
* @return string
*/
function wp_kama_list_pages_filter( $output, $parsed_args, $pages ){
// filter...
return $output;
}
- $output(строка)
- HTML output of the pages list.
- $parsed_args(массив)
- An array of page-listing arguments. See wp_list_pages() for information on accepted arguments.
- $pages(WP_Post[])
- Array of the page objects.
Список изменений
| С версии 1.5.1 | Введена. |
| С версии 4.4.0 | $pages added as arguments. |
Где вызывается хук
wp_list_pages
wp-includes/post-template.php 1381
$html = apply_filters( 'wp_list_pages', $output, $parsed_args, $pages );