Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function my_contacts_list() {
- if( ! function_exists( 'wp_fusion' ) ) {
- return;
- }
- wp_fusion()->crm->connect();
- $return_fields = array( 'Contact.Id', 'Contact.FirstName', 'Contact.LastName', 'Contact.Email' );
- $contacts = wp_fusion()->crm->app->dsQuery( "ContactGroupAssign", 1000, 0, array( 'GroupId' => $tag_id ), $return_fields );
- $out = '<ul>';
- foreach( $contacts as $contact ) {
- $out .= '<li>' . $contact['first_name'] . ' ' . $contact['last_name'] . ' - ' . $contact['user_email'] . '</li>';
- }
- $out .= '</ul>';
- return $out;
- }
- add_shortcode( 'contacts_list', 'my_contacts_list' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement