The service id used to modify the mapped event details. */ $next_attendee = apply_filters( 'tec_automator_map_attendee_details', $next_attendee, $attendee, $service_id ); // Zapier only requires an id field, if that is empty send a generic invalid message. if ( empty( $next_attendee['id'] ) ) { return [ 'id' => 'invalid-attendee-id.' ]; } return $next_attendee; } /** * Get Attendee Meta. * * @since 6.0.0 Migrated to Common from Event Automator * * @param array $attendee An array of attendee details. * * @return array $meta_array Meta attendee array. */ public function get_attendee_meta( $attendee ) { if ( empty( $attendee['attendee_meta'] ) ) { return []; } $meta_array = []; foreach ( $attendee['attendee_meta'] as $key => $item ) { if ( empty( $item['value'] ) ) { continue; } $value = $item['value']; // If value is an array, convert each item to a string and remove the keys. if ( is_array( $value ) ) { $value = array_values( array_map( 'strval', $value ) ); } else { $value = [ (string) $value ]; } $meta_array[] = [ 'attendee_meta_id' => $item['slug'], 'attendee_meta_name' => $item['label'], 'attendee_meta_value' => $value, ]; } return $meta_array; } }