Advertisement
verygoodplugins

Untitled

Dec 11th, 2019
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. function allow_ee_duplicate_contacts_api( $result, $args ) {
  2.  
  3.     if ( did_action( 'AHEE__EE_Registration__set_status__after_update' ) ) {
  4.  
  5.         global $did_first_reg;
  6.  
  7.         if ( $did_first_reg == true ) {
  8.  
  9.             $result = false;
  10.  
  11.         }
  12.  
  13.         $did_first_reg = true;
  14.  
  15.     }
  16.  
  17.     return $result;
  18.  
  19. }
  20.  
  21. add_filter( 'wpf_api_get_contact_id_result', 'allow_ee_duplicate_contacts_api', 10, 2 );
  22.  
  23. function allow_ee_duplicate_contacts_user( $contact_id, $email ) {
  24.  
  25.     if ( did_action( 'AHEE__EE_Registration__set_status__after_update' ) ) {
  26.  
  27.         global $did_first_reg;
  28.  
  29.         if ( $did_first_reg == true ) {
  30.  
  31.             $contact_id = false;
  32.  
  33.         }
  34.  
  35.         $did_first_reg = true;
  36.  
  37.     }
  38.  
  39.     return $contact_id;
  40. }
  41.  
  42. add_filter( 'wpf_contact_id', 'allow_ee_duplicate_contacts_user', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement