WordPress filter hook · part of WordPress core

wp_dropdown_cats

A WordPress core filter that 7 plugins also fire themselves, running on 11K+ sites between them.

“Filters the taxonomy drop-down output.”

How to use wp_dropdown_cats

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:

functions.php
add_filter( 'wp_dropdown_cats', function( $output ) {
	// Change $output here.
	return $output;
}, 10, 1 );

Argument names come from WP Publication Archive'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 →

7 plugins that fire wp_dropdown_cats

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. VK Filter Search icon VK Filter Search6,000+ installs apply_filters( 'wp_dropdown_cats', $output, $parsed_args ) inc/dropdown-categories/dropdown-categories.php:143
  2. Product Table for WooCommerce icon Product Table for WooCommerce5,000+ installs apply_filters( 'wp_dropdown_cats', $output, $parsed_args ) includes/functions.php:820
  3. WP Publication Archive icon WP Publication Archive400+ installs apply_filters( 'wp_dropdown_cats', $output ) lib/class.wp-publication-archive-utilities.php:174
  4. f(x) Categories Widget icon f(x) Categories Widget30+ installs apply_filters( 'wp_dropdown_cats', $output, $r ) includes/functions.php:115
  5. Ninja Shop icon Ninja Shop20+ installs apply_filters( 'wp_dropdown_cats', $output ) lib/functions/functions.php:1008
  6. Shortcode For Bootstrap icon Shortcode For Bootstrap10+ installs apply_filters( 'wp_dropdown_cats', $output ) inc/shortcode-backend.class.php:573
  7. Papa Rss Import icon Papa Rss Import10+ installs apply_filters( 'wp_dropdown_cats', $output ) include/rssagg_dropdown_categories.php:73

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.