noptin_localize_optin_editor( array $state )

Function noptin editor localize.


Parameters Parameters

$state

(array) (Required) the current editor state.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/functions.php

function noptin_localize_optin_editor( $state ) {
	$props   = noptin_get_form_design_props();
	$props[] = 'DisplayOncePerSession';
	$props[] = 'timeDelayDuration';
	$props[] = 'scrollDepthPercentage';
	$props[] = 'cssClassOfClick';
	$props[] = 'triggerPopup';
	$props[] = 'slideDirection';

	$params = array(
		'ajaxurl'      => admin_url( 'admin-ajax.php' ),
		'api_url'      => get_home_url( null, 'wp-json/wp/v2/' ),
		'nonce'        => wp_create_nonce( 'noptin_admin_nonce' ),
		'data'         => $state,
		'templates'    => noptin_get_optin_templates(),
		'color_themes' => array_flip( noptin_get_color_themes() ),
		'design_props' => $props,
		'field_props'  => noptin_get_form_field_props(),
	);

	$params = apply_filters( 'noptin_form_editor_params', $params );

	wp_localize_script( 'noptin-optin-editor', 'noptinEditor', $params );
}


Top ↑

Changelog Changelog

Changelog
VersionDescription
1.0.5Introduced.

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