Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: list_cats

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 3 times in this file.

Line Code
393            * 'show_option_none', 'show_option_all', and various forms of the
394            * term name.
395            *
396            * @since 1.2.0
397            *
398            * @see wp_dropdown_categories()
399            *
400            * @param string $element Taxonomy element to list.
401            */
402           $show_option_none = apply_filters( 'list_cats', $r['show_option_none'] );
403           $output .= "\t<option value='" . esc_attr( $option_none_value ) . "' selected='selected'>$show_option_none</option>\n";
404      }
405
406      if ( ! empty( $categories ) ) {
407
408           if ( $r['show_option_all'] ) {
409
410                /** This filter is documented in wp-includes/category-template.php */
411                $show_option_all = apply_filters( 'list_cats', $r['show_option_all'] );
412                $selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : '';
413                $output .= "\t<option value='0'$selected>$show_option_all</option>\n";
414           }
415
416           if ( $r['show_option_none'] ) {
417
418                /** This filter is documented in wp-includes/category-template.php */
419                $show_option_none = apply_filters( 'list_cats', $r['show_option_none'] );
420                $selected = selected( $option_none_value, $r['selected'], false );
421                $output .= "\t<option value='" . esc_attr( $option_none_value ) . "'$selected>$show_option_none</option>\n";
422           }
423
424           if ( $r['hierarchical'] ) {
425                $depth = $r['depth'];  // Walk the full depth.
426           } else {
427                $depth = -1; // Flat.
428           }