Noptin_WPForms::settings_section_content( stdClass $instance )

Noptin Settings Content


Parameters Parameters

$instance

(stdClass) (Required) The form instance.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/integrations/class-noptin-wpforms.php

    function settings_section_content( $instance ) {
        echo '<div class="wpforms-panel-content-section wpforms-panel-content-section-noptin">';
        echo '<div class="wpforms-panel-content-section-title">Noptin</div>';

        wpforms_panel_field(
            'checkbox',
            'settings',
            'enable_noptin',
            $instance->form_data,
            __( 'Enable Noptin Subscriptions', 'newsletter-optin-box' )
		);

		do_action( 'noptin_wp_forms_before_map_fields_section', $instance );
		echo '<div class="wpforms-map-noptin-fields wpforms-builder-settings-block">';
		echo '<div class="wpforms-builder-settings-block-header">';
		echo '<span>' . __( 'Map Fields', 'newsletter-optin-box' ) . ' <a href="https://noptin.com/guide/integrations/wpforms" target="_blank">' . __( 'Learn More!', 'newsletter-optin-box' ) . '</a></span>';
		echo '</div><div class="wpforms-builder-settings-block-content">';

        wpforms_panel_field(
            'select',
            'settings',
            'noptin_field_email',
            $instance->form_data,
            __( 'Email Address', 'newsletter-optin-box' ),
            array(
                'field_map'   => array( 'email' ),
                'placeholder' => __( '-- Map Field --', 'newsletter-optin-box' ),
            )
		);

		wpforms_panel_field(
            'select',
            'settings',
            'noptin_field_name',
            $instance->form_data,
            __( 'Subscriber Name (Optional)', 'newsletter-optin-box' ),
            array(
                'field_map'   => array( 'text', 'name' ),
                'placeholder' => __( '-- Map Field --', 'newsletter-optin-box' ),
            )
        );

		wpforms_panel_field(
            'select',
            'settings',
            'noptin_field_gdpr',
            $instance->form_data,
            __( 'GDPR checkbox (Optional)', 'newsletter-optin-box' ),
            array(
                'field_map'   => array( 'checkbox', 'gdpr-checkbox' ),
				'placeholder' => __( '-- Map Field --', 'newsletter-optin-box' ),
				'tooltip'     => __( 'If mapped, only users who consent will join your newsletter.', 'newsletter-optin-box' ),
            )
		);

		foreach ( get_special_noptin_form_fields() as $name => $field ) {

            $id    = esc_attr( sanitize_html_class( $name ) );
            $type  = esc_attr( $field[0] );
            $label = wp_kses_post( $field[1] );

            if ( $type === 'text' || $type === 'checkbox' || $type === 'textarea' || $type === 'hidden' ) {

				wpforms_panel_field(
					'select',
					'settings',
					'noptin_field_' . $id,
					$instance->form_data,
					$label,
					array(
						'field_map'   => array( $type ),
						'placeholder' => __( '-- Map Field --', 'newsletter-optin-box' ),
					)
				);

            }

        }

		do_action( 'noptin_wp_forms_map_fields_section', $instance );
		echo '</div>';

		do_action( 'noptin_wp_forms_after_map_fields_section', $instance );
        echo '</div>';
	}


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