常用函数-wp_create_nonce()

0条评论

说明

生成一个随机的、一次性的令牌。

参数

$action

(字符串)(整数)要添加到随机数的标量值。

默认值:-1

返回的值

  • 返回一次性使用的令牌的字符串

示例

<?php $nonce= wp_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');
?>

另见

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.