list_pages
Filters the page title when creating an HTML drop-down list of pages.
Usage
add_filter( 'list_pages', 'wp_kama_list_pages_filter', 10, 2 );
/**
* Function for `list_pages` filter-hook.
*
* @param string $title Page title.
* @param WP_Post $page Page data object.
*
* @return string
*/
function wp_kama_list_pages_filter( $title, $page ){
// filter...
return $title;
}
- $title(string)
- Page title.
- $page(WP_Post)
- Page data object.
Changelog
| Since 3.1.0 | Introduced. |
Where the hook is called
list_pages
wp-includes/class-walker-page-dropdown.php 92
$title = apply_filters( 'list_pages', $title, $page );
Where the hook is used in WordPress
wp-admin/includes/admin-filters.php 170
add_filter( 'list_pages', '_wp_privacy_settings_filter_draft_page_titles', 10, 2 );