wp_verify_nonce()
wp_verify_nonce(string $nonce, string|integer $action = -1) : false|integer
Verify that correct nonce was used with time limit.
The user is given an amount of time to use the token, so therefore, since the UID and $action remain the same, the independent variable is the time.
Parameters
string | $nonce | Nonce that was used in the form to verify. |
string|integer | $action | Should give context to what is taking place and be the same when nonce was created. |
Returns
false|integer —False if the nonce is invalid, 1 if the nonce is valid and generated between 0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.