wordpress/wp-content/themes/basic/themify/themify-builder/modules/module-optin.php
/**
	 * Handles Ajax request to get the options for providers
	 *
	 * @since 4.2.3
	 */
Handles Ajax request to get the options for providers
@since 4.2.3
Handles Ajax request to get the options for providers @since 4 . 2 . 3
function ajax_tb_optin_get_settings() {
		check_ajax_referer( 'tb_load_nonce', 'tb_load_nonce' );
		$providers = Builder_Optin_Service::get_providers();
		$providers_settings = $providers_list = $providers_binding = array();
		foreach ( $providers as $id => $instance ) {
			$providers_list[ $id ] = $instance->get_label();
			$providers_settings[] = array(
				'type' => 'group',
				'options' => $instance->get_options(),
				'wrap_class' => $id
			);
			$providers_binding[ $id ] = array(
				'hide' => array_values(array_diff( array_keys( $providers ), array( $id ) )),
				'show' =>  $id ,
			);
		}
		$options = array(
			array(
				'id' => 'provider',
				'type' => 'select',
				'label' => __( 'Optin Providers', 'themify' ),
				'options' => $providers_list,
				'binding' => $providers_binding
			),
			array(
				'type' => 'group',
				'id' => 'provider_settings',
				'options' => $providers_settings
			),
		);
		echo json_encode( $options );
		die;
	}
function ajax_tb_optin_get_settings ( ) { check_ajax_referer ( 'tb_load_nonce' , 'tb_load_nonce' ) ; $ providers = Builder_Optin_Service :: get_providers ( ) ; $ providers_settings = $ providers_list = $ providers_binding = array ( ) ; foreach ( $ providers as $ id => $ instance ) { $ providers_list [ $ id ] = $ instance -> get_label ( ) ; $ providers_settings [ ] = array ( 'type' => 'group' , 'options' => $ instance -> get_options ( ) , 'wrap_class' => $ id ) ; $ providers_binding [ $ id ] = array ( 'hide' => array_values ( array_diff ( array_keys ( $ providers ) , array ( $ id ) ) ) , 'show' => $ id , ) ; } $ options = array ( array ( 'id' => 'provider' , 'type' => 'select' , 'label' => __ ( 'Optin Providers' , 'themify' ) , 'options' => $ providers_list , 'binding' => $ providers_binding ) , array ( 'type' => 'group' , 'id' => 'provider_settings' , 'options' => $ providers_settings ) , ) ; echo json_encode ( $ options ) ; die ; }
Handles Ajax request to get the options for providers
 @since 4.2.3
Handles Ajax request to get the options for providers @since 4 . 2 . 3