post_link_category

FILTER wp-includes\link-template.php (ligne 244) github
Filters the category that gets used in the %category% permalink token.

Paramètres

Entrée :
$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.

Utilisation

// 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];
}

Actualités

Chargement des actualités...