WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
149 | /** |
150 | * Filters the categories before building the category list. |
151 | * |
152 | * @since 4.4.0 |
153 | * |
154 | * @param WP_Term[] $categories An array of the post's categories. |
155 | * @param int|false $post_id ID of the post to retrieve categories for. |
156 | * When `false`, defaults to the current post in the loop. |
157 | */ |
158 | $categories = apply_filters( 'the_category_list', get_the_category( $post_id ), $post_id ); |
159 |
|
160 | if ( empty( $categories ) ) { |
161 | /** This filter is documented in wp-includes/category-template.php */ |
162 | return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents ); |
163 | } |
164 |
|
165 | $rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"'; |
166 |
|
167 | $thelist = ''; |