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:

functions.php
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.

  1. Jetpack icon Jetpack3+ million installs apply_filters( 'list_pages', $title, $page ) json-endpoints/class.wpcom-json-api-list-dropdown-pages-endpoint.php:222
  2. 301 Redirects icon 301 Redirects300,000+ installs apply_filters( 'list_pages', $object->post_title, $object ) class.drop-down-pages.php:79
  3. Easy Custom Auto Excerpt icon Easy Custom Auto Excerpt6,000+ installs apply_filters( 'list_pages', $page->post_title, $page ) walker_dropdown_multiple.php:33
  4. WC Vendors icon WC Vendors3,000+ installs apply_filters( 'list_pages', $title, $page ) classes/admin/includes/class-wcv-walker-pagedropdown-multiple.php:63
  5. Post Terms Order icon Post Terms Order2,000+ installs apply_filters( 'list_pages', $title, $page ) include/class-walkers.php:205
  6. Manual Related Posts icon Manual Related Posts1,000+ installs apply_filters( 'list_pages', $title, $page ) related.php:517
  7. WP Wrapper icon WP Wrapper600+ installs apply_filters( 'list_pages', $page->post_title, $page ) wp-wrapper.php:30
  8. Post Slider icon Post Slider50+ installs apply_filters( 'list_pages', $page->post_title, $page ) walker_dropdown_multiple.php:34
  9. Digital Board icon Digital Board10+ installs apply_filters( 'list_pages', $page->post_title, $page ) checklist-pages.php:78
  10. QuickDocs icon 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.