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

Line Code
56       *                                   See wp_dropdown_categories().
57       * @param int     $current_object_id Optional. ID of the current category. Default 0.
58       */
59      public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) {
60           // Restores the more descriptive, specific name for use within this method.
61           $category = $data_object;
62           $pad      = str_repeat( ' ', $depth * 3 );
63
64           /** This filter is documented in wp-includes/category-template.php */
65           $cat_name = apply_filters( 'list_cats', $category->name, $category );
66
67           if ( isset( $args['value_field'] ) && isset( $category->{$args['value_field']} ) ) {
68                $value_field = $args['value_field'];
69           } else {
70                $value_field = 'term_id';
71           }
72
73           $output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $category->{$value_field} ) . '"';
74