apply_filters( 'list_cats', string $element, WP_Term|null $category )
- Since
- 1.2.0
Filters a taxonomy drop-down display element.
Description
A variety of taxonomy drop-down display elements can be modified just prior to display via this filter. Filterable arguments include 'show_option_none', 'show_option_all', and various forms of the term name.
Parameters
$elementstring- Category name.
$categoryWP_Term|null- The category object, or null if there's no corresponding category.
Fired at · 5
wp-includes/category-template.php:437wp_dropdown_categories()wp-includes/category-template.php:446wp_dropdown_categories()wp-includes/category-template.php:454wp_dropdown_categories()wp-includes/class-walker-category-dropdown.php:66Walker_CategoryDropdown::start_el()wp-includes/class-walker-category.php:106Walker_Category::start_el()
Source
<?php * * @see wp_dropdown_categories() * * @param string $element Category name. * @param WP_Term|null $category The category object, or null if there's no corresponding category. */ $show_option_none = apply_filters( 'list_cats', $parsed_args['show_option_none'], null ); $output .= "\t<option value='" . esc_attr( $option_none_value ) . "' selected='selected'>$show_option_none</option>\n"; } if ( ! empty( $categories ) ) { if ( $parsed_args['show_option_all'] ) {History
Introduced in 1.2.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.