W3cubDocs

/WordPress

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

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

Parameters

$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.

Source

File: wp-includes/link-template.php

View on Trac

Changelog

Version Description
3.5.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/post_link_category