wp_dropdown_pages
Filter HookDescription
Filters the HTML output of a list of pages as a dropdown.Hook Information
File Location |
wp-includes/post-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1250 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$output
|
HTML output for dropdown list of pages. |
array
|
$parsed_args
|
The parsed arguments array. See wp_dropdown_pages() for information on accepted arguments. |
WP_Post[]
|
$pages
|
Array of the page objects. |
Usage Examples
Basic Usage
<?php
// Hook into wp_dropdown_pages
add_filter('wp_dropdown_pages', 'my_custom_filter', 10, 3);
function my_custom_filter($output, $parsed_args, $pages) {
// Your custom filtering logic here
return $output;
}
Source Code Context
wp-includes/post-template.php:1250
- How this hook is used in WordPress core
<?php
1245 * @param string $output HTML output for dropdown list of pages.
1246 * @param array $parsed_args The parsed arguments array. See wp_dropdown_pages()
1247 * for information on accepted arguments.
1248 * @param WP_Post[] $pages Array of the page objects.
1249 */
1250 $html = apply_filters( 'wp_dropdown_pages', $output, $parsed_args, $pages );
1251
1252 if ( $parsed_args['echo'] ) {
1253 echo $html;
1254 }
1255
PHP Documentation
<?php
/**
* Filters the HTML output of a list of pages as a dropdown.
*
* @since 2.1.0
* @since 4.4.0 `$parsed_args` and `$pages` added as arguments.
*
* @param string $output HTML output for dropdown list of pages.
* @param array $parsed_args The parsed arguments array. See wp_dropdown_pages()
* for information on accepted arguments.
* @param WP_Post[] $pages Array of the page objects.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/post-template.php
Related Hooks
Related hooks will be displayed here in future updates.