Advertisement
verygoodplugins

Untitled

Jun 5th, 2019
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. function my_contacts_list() {
  2.  
  3.     if( ! function_exists( 'wp_fusion' ) ) {
  4.         return;
  5.     }
  6.  
  7.     wp_fusion()->crm->connect();
  8.      
  9.     $return_fields = array( 'Contact.Id', 'Contact.FirstName', 'Contact.LastName', 'Contact.Email' );
  10.      
  11.     $contacts = wp_fusion()->crm->app->dsQuery( "ContactGroupAssign", 1000, 0, array( 'GroupId' => $tag_id ), $return_fields );
  12.  
  13.     $out = '<ul>';
  14.  
  15.     foreach( $contacts as $contact ) {
  16.         $out .= '<li>' . $contact['first_name'] . ' ' . $contact['last_name'] . ' - ' . $contact['user_email'] . '</li>';
  17.     }
  18.  
  19.     $out .= '</ul>';
  20.  
  21.     return $out;
  22.  
  23. }
  24.  
  25. add_shortcode( 'contacts_list', 'my_contacts_list' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement