Codex

Function Reference/wp create nonce

Contents

Description

Creates a random, one time use token.

Parameters

$action
(string) (int) Scalar value to add context to the nonce.
Default: -1

Returns

  • @return string The one use form token.

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.