Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Noptin_Elementor_Forms_Integration::map_fields( ElementorProModulesFormsClassesForm_Record $record )


Parameters Parameters

$record

(ElementorProModulesFormsClassesForm_Record) (Required)


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/integrations/class-noptin-elementor-forms-integration.php

	private function map_fields( $record ) {

		// Retrieve form settings.
		$settings = $record->get( 'form_settings' );

		// Get submitetd Form data.
		$fields = $record->get( 'fields' );

		$subscriber = array(
			'_subscriber_via' => 'Elementor'
		);

		// Referral page.
		if ( ! empty( $_REQUEST['referrer'] ) ) {
			$subscriber['conversion_page'] = esc_url_raw( $_REQUEST['referrer'] );
		}

		// Add the subscriber's IP address.
		$address = noptin_get_user_ip();
		if ( ! empty( $address ) && '::1' !== $address ) {
			$subscriber['ip_address'] = $address;
		}

		foreach ( $settings['noptin_fields_map'] as $map_item ) {
			if ( empty( $fields[ $map_item['local_id'] ]['value'] ) ) {
				continue;
			}

			$subscriber[ $map_item['remote_id'] ] = $fields[ $map_item['local_id'] ]['value'];
		}

		return $subscriber;
	}


Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation