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
91       *
92       * @param string $output   Passed by reference. Used to append additional content.
93       * @param object $category Category data object.
94       * @param int    $depth    Optional. Depth of category in reference to parents. Default 0.
95       * @param array  $args     Optional. An array of arguments. See wp_list_categories(). Default empty array.
96       * @param int    $id       Optional. ID of the current category. Default 0.
97       */
98      public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
99           /** This filter is documented in wp-includes/category-template.php */
100           $cat_name = apply_filters(
101                'list_cats',
102                esc_attr( $category->name ),
103                $category
104           );
105
106           // Don't generate an element if the category name is empty.
107           if ( ! $cat_name ) {
108                return;
109           }