wpseek.com
A WordPress-centric search engine for devs and theme authors



post_link_category › WordPress Filter Hooks

Since3.5.0
Deprecatedn/a
apply_filters( 'post_link_category', $cats[0], $cats, $post )
Parameters: (3)
  • (WP_Term) $cat The category to use in the permalink.
    Required: Yes
  • (array) $cats Array of all categories (WP_Term objects) associated with the post.
    Required: Yes
  • (WP_Post) $post The post in question.
    Required: Yes
Defined at:
Codex:

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





Source

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