post_link_category filter-hook . WP 3.5.0
Filters the category that gets used in the %category% permalink token.
Usage
add_filter( 'post_link_category', 'filter_function_name_8275', 10, 3 ); function filter_function_name_8275( $cat, $cats, $post ){ // filter... return $cat; }
- $cat(WP_Term)
- The category to use in the permalink.
- $cats(array)
- Array of all categories (WP_Term objects) associated with the post.
- $post(WP_Post)
- The post in question.
Changelog
Since 3.5.0 | Introduced. |
Where the hook is called
wp-includes/link-template.php 192
$category_object = apply_filters( 'post_link_category', $cats[0], $cats, $post );