Created
January 6, 2019 02:07
-
-
Save tradesouthwest/6563a578daa6585899e2591e0c7a8557 to your computer and use it in GitHub Desktop.
use snippet to test for ajax or admin referer nonce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tradesouthwest_nonce_test() | |
{ | |
do_action( 'check_admin_referer', $action, $result); | |
if( !$result && ! ( -1 == $action && strpos( $referer, $adminurl ) === 0 ) ) { | |
wp_nonce_ays( $action ); | |
die(); | |
} | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment