Automattic\WooCommerce\EmailEditor\Engine

Theme_Controller::recursive_extract_preset_variablesprivateWC 1.0

Replace preset variables with their values.

Method of the class: Theme_Controller{}

No Hooks.

Returns

Array.

Usage

// private - for code of main (parent) class only
$result = $this->recursive_extract_preset_variables( $styles );
$styles(array) (required)
Styles array.

Theme_Controller::recursive_extract_preset_variables() code WC 10.8.1

private function recursive_extract_preset_variables( $styles ) {
	foreach ( $styles as $key => $style_value ) {
		if ( is_array( $style_value ) ) {
			$styles[ $key ] = $this->recursive_extract_preset_variables( $style_value );
		} elseif ( is_string( $style_value ) && Preset_Variable_Resolver::is_preset_reference( $style_value ) ) {
			$styles[ $key ] = Preset_Variable_Resolver::to_css_var( $style_value );
		} else {
			$styles[ $key ] = $style_value;
		}
	}
	return $styles;
}