Noptin_Gravity_Forms::process_feed( array $feed, array $entry, array $form )
Process the feed action.
Parameters Parameters
- $feed
(array) (Required) The feed object to be processed.
- $entry
(array) (Required) The entry object currently being processed.
- $form
(array) (Required) The form object currently being processed.
Source Source
File: includes/integrations/class-noptin-gravity-forms.php
public function process_feed( $feed, $entry, $form ) { // Map the submitted fields. $field_map = $this->get_field_map_fields( $feed, 'noptinFields' ); // Prepare subscriber details. $subscriber = array( '_subscriber_via' => __( 'Gravity Forms', 'newsletter-optin-box' ), 'conversion_page' => $entry['source_url'], ); // Add the subscriber's IP address. $address = noptin_get_user_ip(); if ( ! empty( $address ) && '::1' !== $address ) { $subscriber['ip_address'] = $address; } // Add mapped fields. foreach ( $field_map as $noptin => $gravity_forms ) { // If no field is mapped, skip it. if ( rgblank( $gravity_forms ) ) { continue; } $subscriber[ $noptin ] = $this->get_field_value( $form, $entry, $gravity_forms ); } // We need an email. if ( empty( $subscriber['email'] ) ) { return; } // Add integration data. $subscriber['integration_data'] = compact( 'form', 'entry', 'feed' ); // Filter the subscriber fields. $subscriber = apply_filters( 'noptin_gravity_forms_integration_new_subscriber_fields', $subscriber, $this ); // Register the subscriber. add_noptin_subscriber( $subscriber ); }
Expand full source code Collapse full source code View on GitHub