Advertisement
verygoodplugins

Untitled

Oct 5th, 2016
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1.     public function update_contact( $contact_id, $data, $map_meta_fields = true ) {
  2.  
  3.         if(is_wp_error( $this->connect() ))
  4.             return false;
  5.  
  6.         if($map_meta_fields == true)
  7.             $data = wp_fusion()->crm_base->map_meta_fields( $data );
  8.  
  9.         if(empty($data))
  10.             return true;
  11.  
  12.         if(!isset($data['email']))
  13.             $data['email'] = $this->get_email_from_cid($contact_id);
  14.  
  15.         $result = $this->app->api( 'contact/sync', $data );
  16.  
  17.         if( $result->success == 1 ) {
  18.  
  19.             return true;
  20.  
  21.         } else {
  22.  
  23.             return false;
  24.  
  25.         }
  26.  
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement