Skip to content

Instantly share code, notes, and snippets.

@aiiddqd
Created October 28, 2017 16:29
Show Gist options
  • Select an option

  • Save aiiddqd/f608e8b285fa725863251d0e89718064 to your computer and use it in GitHub Desktop.

Select an option

Save aiiddqd/f608e8b285fa725863251d0e89718064 to your computer and use it in GitHub Desktop.
private function wooms_nonce_check($nonce = ''){
if(empty($nonce)){
return false;
}
if($nonce == get_transient('wooms_nonce')){
delete_transient('wooms_nonce');
return true;
} else {
return false;
}
}
private function wooms_nonce_create(){
set_transient('wooms_nonce', wp_hash(time()), 60*60);
return get_transient('wooms_nonce');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment