sharing_email_check

The Jetpack by WordPress.com sharing email check function.

Description

sharing_email_check( (bool) $true, $post, $data ); 

Parameters (3)

0. $true (bool)
The true.
1. $post
The post.
2. $data
The data.

Usage

  1. if ( !function_exists( 'sharing_email_check' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/sharedaddy/sharedaddy.php'; 
  3.  
  4. // The true. 
  5. $true = true; 
  6.  
  7. // The post. 
  8. $post = null; 
  9.  
  10. // The data. 
  11. $data = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = sharing_email_check($true, $post, $data); 
  15.  

Defined (1)

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

/modules/sharedaddy/sharedaddy.php  
  1. function sharing_email_check( $true, $post, $data ) { 
  2. require_once plugin_dir_path( __FILE__ ) . 'recaptcha.php'; 
  3.  
  4. $recaptcha = new Jetpack_ReCaptcha( RECAPTCHA_PUBLIC_KEY, RECAPTCHA_PRIVATE_KEY ); 
  5. $response = ! empty( $_POST['g-recaptcha-response'] ) ? $_POST['g-recaptcha-response'] : ''; 
  6. $result = $recaptcha->verify( $response, $_SERVER['REMOTE_ADDR'] ); 
  7.  
  8. return ( true === $result );