如错误消息所述,
$_REQUEST['name_of_your_nonce_field']
未设置。使用前,您需要确保已设置:
function hi_in_wp_head() {
?>
<form name="f1">
<input name="i1" value="hi_in_wp_head">
<input type="submit" name="s1">
<?php wp_nonce_field('name_of_your_action', 'name_of_your_nonce_field'); ?>
</form>
<?php
if(isset($_REQUEST['name_of_your_nonce_field']) {
if(wp_verify_nonce($_REQUEST['name_of_your_nonce_field'], 'name_of_your_action')){
// Nonce is matched and valid. do whatever you want now.
} else {
// Invalid nonce. you can throw an error here.
die("ups 19-02-28_17-09");
}
}
}
$\u请求['name\u of \u your\u nonce\u field']
将设置
之后
你的表格已经提交了。所以你需要额外的支票。