pre_post_link

FILTER wp-includes\link-template.php (ligne 217) github
Filters the permalink structure for a post before token replacement occurs. Only applies to posts with post_type of 'post'.

Paramètres

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

Utilisation

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

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

Actualités

Chargement des actualités...