check_ajax_referer

FUNCTION wp-includes\pluggable.php (ligne 1377) github
Fires once the admin request has been validated or not.

Paramètres

Entrée :
$action = -1, $query_arg = false, $stop = true
Sortie :
@param string    $action The nonce action.
@param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
@param int|string   $action    Action nonce.
@param false|string $query_arg Optional. Key to check for the nonce in `$_REQUEST` (since 2.5). If false,
@param bool         $stop      Optional. Whether to stop early when the nonce cannot be verified.
@return int|false 1 if the nonce is valid and generated between 0-12 hours ago,

Utilisation

// Utilisation de la fonction check_ajax_referer
$result = check_ajax_referer($action = -1, $query_arg = false, $stop = true);

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...