acf_verify_nonce()
acf_verify_nonce
This function will look at the $_POST['_acf_nonce'] value and return true or false
No Hooks.
Returns
(true|false).
Usage
acf_verify_nonce( $value );
- $value(required)
- .
Changelog
| Since 5.0.0 | Introduced. |
acf_verify_nonce() acf verify nonce code ACF 6.8.8
function acf_verify_nonce( $value ) {
// vars
$nonce = acf_maybe_get_POST( '_acf_nonce' );
// bail early nonce does not match (post|user|comment|term)
if ( ! $nonce || ! wp_verify_nonce( $nonce, $value ) ) {
return false;
}
// reset nonce (only allow 1 save)
$_POST['_acf_nonce'] = false;
// return
return true;
}