Ajax::verify_nonce()
Description #
Verify nonce and die if failed.
Nonce key is stored in $nonce_key
property. To bypass verification simply set $nonce_key
to an empty value.
Source #
File: classes/ajax.php
120 121 122 123 124 125 126 127 128 129 130 131 132 | private function verify_nonce() { if ( empty ( $this ->nonce_key ) ) { return ; } $nonce = ap_sanitize_unslash( '__nonce' , 'r' ); // Verify nonce. if ( ! wp_verify_nonce( $nonce , $this ->nonce_key ) ) { $this ->snackbar( __( 'Trying to cheat?!' , 'anspress-question-answer' ) ); $this ->send(); } } |
Expand full source code Collapse full source code View on GitHub: classes/ajax.php:120
Add your comment