RTMediaAlbum::verify_nonce PHP Method

verify_nonce() public method

Method verifies the nonce passed while performing any CRUD operations on the album.
public verify_nonce ( type $mode ) : boolean
$mode type
return boolean
    function verify_nonce($mode)
    {
        $nonce = $mode = '';
        if (isset($_REQUEST["rtmedia_{$mode}_album_nonce"])) {
            $nonce = sanitize_text_field(wp_unslash($_REQUEST["rtmedia_{$mode}_album_nonce"]));
        }
        if (isset($_REQUEST['mode'])) {
            $mode = sanitize_text_field(wp_unslash($_REQUEST['mode']));
        }
        if (wp_verify_nonce($nonce, 'rtmedia_' . $mode)) {
            return true;
        } else {
            return false;
        }
    }