Inpsyde\MultilingualPress\Common\Nonce\WPNonce::is_valid PHP Method

is_valid() public method

Checks if the nonce is valid with respect to the current context.
Since: 3.0.0
public is_valid ( ) : boolean
return boolean Whether or not the nonce is valid.
    public function is_valid()
    {
        if (!$this->context) {
            $this->context = new OriginalRequestContext();
        }
        if (!isset($this->context[$this->action])) {
            return false;
        }
        $nonce = $this->context[$this->action];
        if (!is_string($nonce)) {
            return false;
        }
        return (bool) wp_verify_nonce($nonce, $this->get_hash());
    }