apply_filters( ‘post_link_category’, WP_Term $cat, array $cats, WP_Post $post )

In this article

Filters the category that gets used in the %category% permalink token.

Parameters

$catWP_Term
The category to use in the permalink.
$catsarray
Array of all categories (WP_Term objects) associated with the post.
$postWP_Post
The post in question.

Source

$category_object = apply_filters( 'post_link_category', $cats[0], $cats, $post );

Changelog

VersionDescription
3.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.