post_type_link

FILTER wp-includes\link-template.php (ligne 375) github
Filters the permalink for a post of a custom post type.

Paramètres

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

Utilisation

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

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

Actualités

Chargement des actualités...