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_Ninja_Forms::map_fields( array $settings )
Parameters Parameters
- $settings
(array) (Required)
Return Return
(array)
Source Source
File: includes/integrations/class-noptin-ninja-forms.php
private function map_fields( $settings ) { // Prepare subscriber details. $subscriber = array( '_subscriber_via' => __( 'Ninja Forms', 'newsletter-optin-box' ), ); // Add the subscriber's IP address. $address = noptin_get_user_ip(); if ( ! empty( $address ) && '::1' !== $address ) { $subscriber['ip_address'] = $address; } // Add map fields. $map_fields = wp_list_pluck( $this->get_map_fields(), 'name' ); foreach ( $map_fields as $field ) { if ( isset( $settings[ "noptin_$field" ] ) ) { $subscriber[ $field ] = $settings[ "noptin_$field" ]; } } return $subscriber; }
Expand full source code Collapse full source code View on GitHub