Codex

Function Reference/wp verify nonce

Contents

Description

Verify that correct nonce was used with time limit.

Parameters

$nonce
(string) (required) Nonce that was used in the form to verify.
Default: None
$action
(string) (int) Should give context to what is taking place and be the same when nonce was created.
Default: -1

Returns

  • @return bool Whether the nonce check passed or failed.

Example

<?php $noncewp_create_nonce  ('my-nonce'); ?>
<a href='myplugin.php?_wpnonce=<?php echo $nonce ?>'> ...

<?php 
$nonce
=$_REQUEST['_wpnonce'];
if (! 
wp_verify_nonce($nonce'my-nonce') ) die('Security check'); 
?>

See also


This page is marked as incomplete. You can help Codex by expanding it.