Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: the_category_list

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
135      /**
136       * Filters the categories before building the category list.
137       *
138       * @since 4.4.0
139       *
140       * @param array    $categories An array of the post's categories.
141       * @param int|bool $post_id    ID of the post we're retrieving categories for. When `false`, we assume the
142       *                             current post in the loop.
143       */
144      $categories = apply_filters( 'the_category_list', get_the_category( $post_id ), $post_id );
145
146      if ( empty( $categories ) ) {
147           /** This filter is documented in wp-includes/category-template.php */
148           return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );
149      }
150
151      $rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"';
152
153      $thelist = '';