WordPress filter hook · part of WordPress core

wp_dropdown_pages

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

“Filter the HTML output of a list of pages as a drop down.”

How to use wp_dropdown_pages

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_pages', function( $output ) {
	// Change $output here.
	return $output;
}, 10, 1 );

Argument names come from CM Pop-Up'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 wp_dropdown_pages

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

  1. PublishPress Revisions: Duplicate Posts, Submit, Approve and Schedule Content Changes icon PublishPress Revisions: Duplicate Posts, Submit, Approve and Schedule Content Changes10,000+ installs apply_filters( 'wp_dropdown_pages', $output, $parsed_args, $pages ) revisionary_main.php:475
  2. CM Pop-Up icon CM Pop-Up8,000+ installs apply_filters( 'wp_dropdown_pages', $output ) shared/functions.php:470
  3. Post Terms Order icon Post Terms Order2,000+ installs apply_filters( 'wp_dropdown_pages', $output ) include/class-interface.php:805
  4. WP Wrapper icon WP Wrapper600+ installs apply_filters( 'wp_dropdown_pages', $output ) wp-wrapper.php:73
  5. Simple Sidebar Navigation icon Simple Sidebar Navigation200+ installs apply_filters( 'wp_dropdown_pages', $output ) simple-sidenav.php:38
  6. CM Table Of Contents icon CM Table Of Contents100+ installs apply_filters( 'wp_dropdown_pages', $output ) functions.php:456
  7. CM Product Recommendation Widget icon CM Product Recommendation Widget10+ installs apply_filters( 'wp_dropdown_pages', $output ) functions.php:324
  8. Shortcode For Bootstrap icon Shortcode For Bootstrap10+ installs apply_filters( 'wp_dropdown_pages', $output ) inc/shortcode-backend.class.php:480
  9. QuickDocs icon QuickDocsFewer than 10 installs apply_filters( 'wp_dropdown_pages', $output, $parsed_args, $pages ) src/template-tags.php:538
  10. WP Chargebee icon WP ChargebeeFewer than 10 installs apply_filters( 'wp_dropdown_pages', $output, $r, $pages ) content/content-settings-menu.php:157

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.