Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: the_category

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
94                if ( in_array( $category->term_id, $args['selected_cats'], true ) ) {
95                     $inner_class .= ' selected';
96                     $aria_checked = 'true';
97                }
98
99                $output .= "\n" . '<li' . $class . '>' .
100                     '<div class="' . $inner_class . '" data-term-id=' . $category->term_id .
101                     ' tabindex="0" role="checkbox" aria-checked="' . $aria_checked . '">' .
102                     /** This filter is documented in wp-includes/category-template.php */
103                     esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</div>';
104           } else {
105                $is_selected = in_array( $category->term_id, $args['selected_cats'], true );
106                $is_disabled = ! empty( $args['disabled'] );
107
108                $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" .
109                     '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' .
110                     checked( $is_selected, true, false ) .
111                     disabled( $is_disabled, true, false ) . ' /> ' .
112                     /** This filter is documented in wp-includes/category-template.php */
113                     esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</label>';
114           }
115      }
116
117      /**
118       * Ends the element output, if needed.
119       *
120       * @see Walker::end_el()
121       *
122       * @since 2.5.1