post_link

FILTER wp-includes\link-template.php (ligne 308) github
Filters the permalink for a post. Only applies to posts with post_type of 'post'.

Paramètres

Entrée :
$permalink, $post, $leavename
Sortie :
@param string  $permalink The post's permalink.
@param WP_Post $post      The post in question.
@param bool    $leavename Whether to keep the post name.

Utilisation

// Modifier la valeur avec le filtre 'post_link'
add_filter('post_link', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($permalink) {
    // Modifier la valeur
    return $permalink;
}

Actualités

Chargement des actualités...