wp_verify_nonce

<?php wp_verify_nonce( $nonce, $action ); ?>

$nonce
(string) (required) Nonce to verify.
Default: None
$action
(string/int) (optional) Action name. Should give the context to what is taking place and be the same when the nonce was created.
Default: -1

Return Values

(boolean/integer) 
Boolean false if the nonce is invalid. Otherwise, returns an integer with the value of:
  • 1 – if the nonce has been generated in the past 12 hours or less.
  • 2 – if the nonce was generated between 12 and 24 hours ago.

此处评论已关闭