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 2 times in this file.

Line Code
359      $categories = get_categories( $r );
360      $name = esc_attr($name);
361      $class = esc_attr($class);
362
363      $output = '';
364      if ( ! empty( $categories ) ) {
365           $output = "<select name='$name' id='$name' class='$class' $tab_index_attribute>\n";
366
367           if ( $show_option_all ) {
368                $show_option_all = apply_filters( 'list_cats', $show_option_all );
369                $selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : '';
370                $output .= "\t<option value='0'$selected>$show_option_all</option>\n";
371           }
372
373           if ( $show_option_none ) {
374                $show_option_none = apply_filters( 'list_cats', $show_option_none );
375                $selected = ( '-1' === strval($r['selected']) ) ? " selected='selected'" : '';
376                $output .= "\t<option value='-1'$selected>$show_option_none</option>\n";
377           }
378
379           if ( $hierarchical )
380                $depth = $r['depth'];  // Walk the full depth.
381           else
382                $depth = -1; // Flat.
383