get_shortlink

FILTER wp-includes\link-template.php (ligne 4209) github
Filters the shortlink for a post.

Paramètres

Entrée :
$shortlink, $id, $context, $allow_slugs
Sortie :
@param string $shortlink   Shortlink URL.
@param int    $id          Post ID, or 0 for the current post.
@param string $context     The context for the link. One of 'post' or 'query',
@param bool   $allow_slugs Whether to allow post slugs in the shortlink. Not used by default.

Utilisation

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

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

Actualités

Chargement des actualités...