wordpress/wp-content/themes/basic/themify/themify-metabox/includes/themify-metabox-core.php
/**
	 * Localize required data for manage color and gradient swatches
	 * @since 4.5
	 */
Localize required data for manage color and gradient swatches
@since 4.5
Localize required data for manage color and gradient swatches @since 4 . 5
public static function themify_localize_cm_data() {
	    $default['colors'] = array(
	            '99999'=>array('color'=>'rgb(96,91,168)','opacity'=>'1','uid'=>'99999'),
	            '88888'=>array('color'=>'rgb(240,110,170)','opacity'=>'1','uid'=>'88888'),
	            '77777'=>array('color'=>'rgb(255,242,4)','opacity'=>'1','uid'=>'77777'),
	            '66666'=>array('color'=>'rgb(254,101,0)','opacity'=>'1','uid'=>'66666'),
	            '55555'=>array('color'=>'rgb(238,35,18)','opacity'=>'1','uid'=>'55555'),
	            '44444'=>array('color'=>'rgb(140,197,63)','opacity'=>'1','uid'=>'44444'),
	            '33333'=>array('color'=>'rgb(27,187,180)','opacity'=>'1','uid'=>'33333'),
	            '22222'=>array('color'=>'rgb(96,204,247)','opacity'=>'1','uid'=>'22222'),
	            '11111'=>array('color'=>'rgb(255,255,255)','opacity'=>'1','uid'=>'11111'),
	            '11110'=>array('color'=>'rgb(0,0,0)','opacity'=>'1','uid'=>'11110'),
        );
		$colors = unserialize( get_option( 'themify_saved_colors', serialize( $default['colors'] ) ) );
        if(is_array($colors) && !empty($colors)){
			$test_color = current($colors);
			$colors = is_array($test_color) && !empty($test_color['color']) ? $colors : $default['colors'];
        }else if(!is_array($colors)){
            $colors = $default['colors'];
        }
		unset($default);
		$grads = unserialize( get_option( 'themify_saved_gradients', serialize( array() ) ) );
        if(is_array($grads) && !empty($grads)){
			$test_color = current($grads);
			$grads = is_array($test_color) && !empty($test_color['setting']) ? $grads : array();
		}else if (!is_array($grads)){
			$grads = array();
		}
		return array(
			'nonce' => wp_create_nonce( 'ajax-nonce' ),
			'ajax_url' => admin_url( 'admin-ajax.php' ),
			'colors' => $colors,
			'gradients' => $grads,
			'exportColorsURL' => add_query_arg( 'themify_export_colors', 'true', wp_nonce_url( admin_url( 'admin.php?page=themify' ), 'themify_export_colors_nonce' ) ),
			'exportGradientsURL' => add_query_arg( 'themify_export_gradients', 'true', wp_nonce_url( admin_url( 'admin.php?page=themify' ), 'themify_export_colors_nonce' ) ),
			'labels' => array(
				'import' => __( 'Import', 'themify' ),
				'export' => __( 'Export', 'themify' ),
				'save' => __( 'Save', 'themify' ),
				'ie' => __( 'Import/Export', 'themify' )
			)
		);
	}
public static function themify_localize_cm_data ( ) { $ default [ 'colors' ] = array ( '99999' => array ( 'color' => 'rgb(96,91,168)' , 'opacity' => '1' , 'uid' => '99999' ) , '88888' => array ( 'color' => 'rgb(240,110,170)' , 'opacity' => '1' , 'uid' => '88888' ) , '77777' => array ( 'color' => 'rgb(255,242,4)' , 'opacity' => '1' , 'uid' => '77777' ) , '66666' => array ( 'color' => 'rgb(254,101,0)' , 'opacity' => '1' , 'uid' => '66666' ) , '55555' => array ( 'color' => 'rgb(238,35,18)' , 'opacity' => '1' , 'uid' => '55555' ) , '44444' => array ( 'color' => 'rgb(140,197,63)' , 'opacity' => '1' , 'uid' => '44444' ) , '33333' => array ( 'color' => 'rgb(27,187,180)' , 'opacity' => '1' , 'uid' => '33333' ) , '22222' => array ( 'color' => 'rgb(96,204,247)' , 'opacity' => '1' , 'uid' => '22222' ) , '11111' => array ( 'color' => 'rgb(255,255,255)' , 'opacity' => '1' , 'uid' => '11111' ) , '11110' => array ( 'color' => 'rgb(0,0,0)' , 'opacity' => '1' , 'uid' => '11110' ) , ) ; $ colors = unserialize ( get_option ( 'themify_saved_colors' , serialize ( $ default [ 'colors' ] ) ) ) ; if ( is_array ( $ colors ) && ! empty ( $ colors ) ) { $ test_color = current ( $ colors ) ; $ colors = is_array ( $ test_color ) && ! empty ( $ test_color [ 'color' ] ) ? $ colors : $ default [ 'colors' ] ; } else if ( ! is_array ( $ colors ) ) { $ colors = $ default [ 'colors' ] ; } unset ( $ default ) ; $ grads = unserialize ( get_option ( 'themify_saved_gradients' , serialize ( array ( ) ) ) ) ; if ( is_array ( $ grads ) && ! empty ( $ grads ) ) { $ test_color = current ( $ grads ) ; $ grads = is_array ( $ test_color ) && ! empty ( $ test_color [ 'setting' ] ) ? $ grads : array ( ) ; } else if ( ! is_array ( $ grads ) ) { $ grads = array ( ) ; } return array ( 'nonce' => wp_create_nonce ( 'ajax-nonce' ) , 'ajax_url' => admin_url ( 'admin-ajax.php' ) , 'colors' => $ colors , 'gradients' => $ grads , 'exportColorsURL' => add_query_arg ( 'themify_export_colors' , 'true' , wp_nonce_url ( admin_url ( 'admin.php?page=themify' ) , 'themify_export_colors_nonce' ) ) , 'exportGradientsURL' => add_query_arg ( 'themify_export_gradients' , 'true' , wp_nonce_url ( admin_url ( 'admin.php?page=themify' ) , 'themify_export_colors_nonce' ) ) , 'labels' => array ( 'import' => __ ( 'Import' , 'themify' ) , 'export' => __ ( 'Export' , 'themify' ) , 'save' => __ ( 'Save' , 'themify' ) , 'ie' => __ ( 'Import/Export' , 'themify' ) ) ) ; }
Localize required data for manage color and gradient swatches
 @since 4.5
Localize required data for manage color and gradient swatches @since 4 . 5
// validate colors value // validate gradients value // Localize required data for color manager