WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 3 times in this file.
| Line | Code |
|---|---|
| 392 | * term name. |
| 393 | * |
| 394 | * @since 1.2.0 |
| 395 | * |
| 396 | * @see wp_dropdown_categories() |
| 397 | * |
| 398 | * @param string $element Category name. |
| 399 | * @param WP_Term|null $category The category object, or null if there's no corresponding category. |
| 400 | */ |
| 401 | $show_option_none = apply_filters( 'list_cats', $r['show_option_none'], null ); |
| 402 | $output .= "\t<option value='" . esc_attr( $option_none_value ) . "' selected='selected'>$show_option_none</option>\n"; |
| 403 | } |
| 404 | |
| 405 | if ( ! empty( $categories ) ) { |
| 406 | |
| 407 | if ( $r['show_option_all'] ) { |
| 408 | |
| 409 | /** This filter is documented in wp-includes/category-template.php */ |
| 410 | $show_option_all = apply_filters( 'list_cats', $r['show_option_all'], null ); |
| 411 | $selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : ''; |
| 412 | $output .= "\t<option value='0'$selected>$show_option_all</option>\n"; |
| 413 | } |
| 414 | |
| 415 | if ( $r['show_option_none'] ) { |
| 416 | |
| 417 | /** This filter is documented in wp-includes/category-template.php */ |
| 418 | $show_option_none = apply_filters( 'list_cats', $r['show_option_none'], null ); |
| 419 | $selected = selected( $option_none_value, $r['selected'], false ); |
| 420 | $output .= "\t<option value='" . esc_attr( $option_none_value ) . "'$selected>$show_option_none</option>\n"; |
| 421 | } |
| 422 | |
| 423 | if ( $r['hierarchical'] ) { |
| 424 | $depth = $r['depth']; // Walk the full depth. |
| 425 | } else { |
| 426 | $depth = -1; // Flat. |
| 427 | } |