/**
* Check if the nonce is valid. Returns false if the nonce is missing and
* throws an exception if it's invalid. If all goes well, returns true.
*
* @return boolean
*/
protected function is_valid_nonce()
{
if (empty($_POST['fieldmanager-' . $this->fm->name . '-nonce'])) {
return false;
}
if (!wp_verify_nonce($_POST['fieldmanager-' . $this->fm->name . '-nonce'], 'fieldmanager-save-' . $this->fm->name)) {
$this->fm->_unauthorized_access(__('Nonce validation failed', 'fieldmanager'));
}
return true;
}