WordPress filter hook · part of WordPress core
wp_list_categories
A WordPress core filter that 5 plugins also fire themselves, running on 41K+ sites between them.
“Filter the HTML output of a taxonomy list.”
How to use wp_list_categories
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'wp_list_categories', function( $output ) {
// Change $output here.
return $output;
}, 10, 1 );Argument names come from Alpha’s Categories Widget'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 →
5 plugins that fire wp_list_categories
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WPtouch40,000+ installs
apply_filters( 'wp_list_categories', $output, $r )themes/foundation/root-functions.php:1473 -
WP Publication Archive400+ installs
apply_filters( 'wp_list_categories', $output, $args )lib/class.wp-publication-archive-utilities.php:266 -
WP Multilingual Sitemap200+ installs
apply_filters( 'wp_list_categories', $html )wp-multilingual-sitemap.php:229 -
Alpha’s Categories Widget20+ installs
apply_filters( 'wp_list_categories', $output )alpha_categories.php:229 -
WP Categories and Posts10+ installs
apply_filters( 'wp_list_categories', $output )wp-categories-and-posts.php:213
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.