WordPress filter hook · part of WordPress core
list_pages
A WordPress core filter that 10 plugins also fire themselves, running on 3.3M+ sites between them.
“Filters the page title when creating an HTML drop-down list of pages.”
How to use list_pages
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'list_pages', function( $title, $page ) {
// Change $title here.
return $title;
}, 10, 2 );Argument names come from Jetpack's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
10 plugins that fire list_pages
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Jetpack3+ million installs
apply_filters( 'list_pages', $title, $page )json-endpoints/class.wpcom-json-api-list-dropdown-pages-endpoint.php:222 -
301 Redirects300,000+ installs
apply_filters( 'list_pages', $object->post_title, $object )class.drop-down-pages.php:79 -
Easy Custom Auto Excerpt6,000+ installs
apply_filters( 'list_pages', $page->post_title, $page )walker_dropdown_multiple.php:33 -
WC Vendors3,000+ installs
apply_filters( 'list_pages', $title, $page )classes/admin/includes/class-wcv-walker-pagedropdown-multiple.php:63 -
Post Terms Order2,000+ installs
apply_filters( 'list_pages', $title, $page )include/class-walkers.php:205 -
Manual Related Posts1,000+ installs
apply_filters( 'list_pages', $title, $page )related.php:517 -
WP Wrapper600+ installs
apply_filters( 'list_pages', $page->post_title, $page )wp-wrapper.php:30 -
Post Slider50+ installs
apply_filters( 'list_pages', $page->post_title, $page )walker_dropdown_multiple.php:34 -
Digital Board10+ installs
apply_filters( 'list_pages', $page->post_title, $page )checklist-pages.php:78 -
QuickDocsFewer than 10 installs
apply_filters( 'list_pages', $title, $page )src/template-tags.php:519
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.