wpcf7_verify_nonce

The Contact Form 7 wpcf7 verify nonce function.

Description

wpcf7_verify_nonce( $nonce, (int) $action = -1 ); 

Parameters (2)

0. $nonce
The nonce.
1. $action — Optional. (int) => -1
The action.

Usage

  1. if ( !function_exists( 'wpcf7_verify_nonce' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/includes/functions.php'; 
  3.  
  4. // The nonce. 
  5. $nonce = null; 
  6.  
  7. // The action. 
  8. $action = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wpcf7_verify_nonce($nonce, $action); 
  12.  

Defined (1)

The function is defined in the following location(s).

/includes/functions.php  
  1. function wpcf7_verify_nonce( $nonce, $action = -1 ) { 
  2. if ( substr( wp_hash( $action, 'nonce' ), -12, 10 ) == $nonce ) { 
  3. return true; 
  4.  
  5. return false;