Filters the category that gets used in the %category% permalink token.
$cats[0], $cats, $post
Sortie :
@param WP_Term $cat The category to use in the permalink. @param array $cats Array of all categories (WP_Term objects) associated with the post. @param WP_Post $post The post in question.
// Modifier la valeur avec le filtre 'post_link_category'
add_filter('post_link_category', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($cats[0]) {
// Modifier la valeur
return $cats[0];
}
Chargement des actualités...