WordPress filter hook · part of WordPress core
wp_list_pages
A WordPress core filter that 13 plugins also fire themselves, running on 11K+ sites between them.
“Filters the HTML output of the pages to list.”
How to use wp_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( 'wp_list_pages', function( $output, $r ) {
// Change $output here.
return $output;
}, 10, 2 );Argument names come from GNA Post Order'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 →
13 plugins that fire wp_list_pages
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Advanced Sidebar Menu10,000+ installs
apply_filters( 'wp_list_pages', $this->output, $this->args, $pages )src/List_Pages.php:281 -
WPComplete1,000+ installs
apply_filters( 'wp_list_pages', $output, $r, $pages )public/class-wpcomplete-public.php:1763 -
Sitemap with woocommerce100+ installs
apply_filters( 'wp_list_pages', $output, $r, $pages )index.php:289 -
GNA Post Order100+ installs
apply_filters( 'wp_list_pages', $output, $r )admin/gna-post-order-admin-sortpage-menu.php:209 -
Documentation100+ installs
apply_filters( 'wp_list_pages', $output, $r )lib/views/class-documentation-renderer.php:487 -
Custom Page Menus60+ installs
apply_filters( 'wp_list_pages', $output, $r )template-tag.php:49 -
All Round Order30+ installs
apply_filters( 'wp_list_pages', $output, $r )1.1/all-round-order.php:253 -
WP YUI Menu10+ installs
apply_filters( 'wp_list_pages', $output )wp-yui-menu.php:72 -
Custom Post Type Privacy10+ installs
apply_filters( 'wp_list_pages', $out )cpt-sentry-widgets.php:40 -
SF Bootstrap Menu10+ installs
apply_filters( 'wp_list_pages', $output )sf-menu-widget.php:257 -
Easy Post Re-Order10+ installs
apply_filters( 'wp_list_pages', $output, $r )files/easysoftonic-my-easy-class.php:398 -
Tagged Sitemap10+ installs
apply_filters( 'wp_list_pages', $output, $r )functions.php:43 -
MindValley Show Last EditedFewer than 10 installs
apply_filters( 'wp_list_pages', $output, $r )mindvalley-last-edited-post.php:158
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.