February 12, 2011 5:54 am
Definition:
function wp_verify_nonce($nonce, $action = -1) {}
returns:Whether the nonce check passed or failed.
function wp_verify_nonce($nonce, $action = -1) {
$user = wp_get_current_user();
$uid = (int) $user->ID;
$i = wp_nonce_tick();
// Nonce generated 0-12 hours ago
if ( substr(wp_hash($i . $action . $uid, 'nonce'), -12, 10) == $nonce )
return 1;
// Nonce generated 12-24 hours ago
if ( substr(wp_hash(($i - 1) . $action . $uid, 'nonce'), -12, 10) == $nonce )
return 2;
// Invalid nonce
return false;
}
4259
Posted by Thorsten
Categories: /wp-includes/pluggable.php, Documentation, Files, Functions, Functions by letter w
Tags: codex, id2eaefcc5c3eed61fa12835e8e63b965f, wp_verify_nonce
Mobile Site | Full Site
Get a free blog at WordPress.com Theme: WordPress Mobile Edition by Alex King.