Why am I getting a 403 from check_admin_referer()?
-
I’m trying to use
check_admin_referer(). I’ve followed the example in the codex and I believe I have everything set up correctly but I get a 403.Here’s the bare bones:
class StupidClass {
...
public function render_page(){
?>
<form action="" id="stupid_form" method="post">
<?php wp_nonce_field('hello', 'token'); ?>
<input type="submit" value="hit me">
</form>
<?php
}public function hello(){
check_admin_referer('hello', 'token');
wp_die();
}
}
It works if I use
check_admin_referer()without arguments but that is no longer recommended. Is there anything obvious that I’ve missed?
The topic ‘Why am I getting a 403 from check_admin_referer()?’ is closed to new replies.