Advertisement
verygoodplugins

Untitled

Feb 10th, 2020
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. add_filter(
  2.     'wpf_crm_object_type', function() {
  3.         return 'Videos';
  4.     }
  5. );
  6.  
  7. $video_data = array(
  8.     'fieldOne' => 'valueOne',
  9.     'fieldTwo' => 'valueTwo',
  10. );
  11.  
  12. $video_id = wp_fusion()->crm->add_contact( $video_data );
  13.  
  14. if ( is_wp_error( $video_id ) ) {
  15.     error_log(print_r($video_id, true));
  16.     return;
  17. }
  18.  
  19. add_filter(
  20.     'wpf_crm_object_type', function() {
  21.         return 'Contacts';
  22.     }
  23. );
  24.  
  25. $contact_data = array(
  26.     'First_Name'  => 'firstname',
  27.     'Last_Name'   => 'lastname',
  28.     'Email'       => 'email@domain.com',
  29.     'Cust_Videos' => array( $video_id )
  30. );
  31.  
  32. $contact_id = wp_fusion()->crm->add_contact( $contact_data );
  33.  
  34. if ( is_wp_error( $contact_id ) ) {
  35.     error_log(print_r($contact_id, true));
  36.     return;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement