pre_get_shortlink

FILTER wp-includes\link-template.php (ligne 4167) github
Filters whether to preempt generating a shortlink for the given post. Returning a value other than false from the filter will short-circuit the shortlink generation process, returning that value instead.

Paramètres

Entrée :
false, $id, $context, $allow_slugs
Sortie :
@param false|string $return      Short-circuit return value. Either false or a URL string.
@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.

Utilisation

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

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

Actualités

Chargement des actualités...