Working with wordpress nonce for securing forms and ajax

September 17th, 2020 Shabu James 18 Views 0 Uncategorised22 seconds
<?php wp_nonce_field( 'name_of_my_action', 'name_of_nonce_field' ); ?>
if ( 
    ! isset( $_POST['name_of_nonce_field'] ) 
    || ! wp_verify_nonce( $_POST['name_of_nonce_field'], 'name_of_my_action' ) 
) {
 
   print 'Sorry, your nonce did not verify.';
   exit;
 
} else {
 
   // process form data
}

About The Author

Shabu James

Leave Your Thoughts Here...
Notice: Undefined variable: comment in /home/letshmvm/public_html/wp-content/themes/shabu-portfolio/functions.php on line 557

We are glad you have chosen to leave a comment. Please keep in mind that comments are moderated according to our comment policy.

Name *
Comment

We are glad you have chosen to leave a comment. Please keep in mind that comments are moderated according to our comment policy.