build_api_endpoint(); $raw = wp_unslash($_POST); $payload = $this->clean_payload(is_array($raw) ? $raw : array()); // Sanitize every remaining field value before it leaves the site. foreach ($payload as $key => $value) { if (is_array($value)) { foreach ($value as $k => $v) { $payload[$key][$k] = sanitize_text_field((string) $v); } } else { $payload[$key] = sanitize_text_field((string) $value); } } $payload['leadcrm_token'] = $token; $payload['cf_reference'] = $cf_reference; $leadcrm_api->submit_lead_to_leadcrm($endpoint, $payload, Leadcrm_Content_Type::JSON); } } /** * A. Houzez Built-in fields * The doco link? Nope, found it simply by testing the submission and check the payload :v * * === Common === * 'name', * 'email', * 'message', * 'target_email', * 'property_permalink', * 'property_title', * 'listing_id', * 'agent_id', * 'agent_type', * * === Only available with action "houzez_property_agent_contact" === * 'property_id', * 'mobile', * 'user_type', * * === Only available with action "houzez_schedule_send_message" === * 'schedule_tour_type', * 'schedule_date', * 'schedule_time', * * === Only available with action "houzez_contact_realtor" === * === Sample url: http://localhost:8080/?houzez_agent=vincent-fuller === * 'source_link', * * B. Elementor Widget Fields * For this, it can be as flexible as user define from the elementor builder page * but mostly will follow Houzez built-in fields */