Automattic\WooCommerce\EmailEditor\Engine

Site_Style_Sync_Controller::resolve_and_assignprivateWC 1.0

Resolve and assign a single style property

Method of the class: Site_Style_Sync_Controller{}

No Hooks.

Returns

true|false. True if the property was resolved and assigned, false otherwise.

Usage

// private - for code of main (parent) class only
$result = $this->resolve_and_assign( $styles, $property, $target, ?callable $processor ): bool;
$styles(array) (required)
The source styles array.
$property(string) (required)
The property key to resolve.
$target(array) (required)
The target array to assign the value to.
?callable $processor
.
Default: null

Site_Style_Sync_Controller::resolve_and_assign() code WC 10.4.3

private function resolve_and_assign( array $styles, string $property, array &$target, ?callable $processor = null ): bool {
	if ( ! isset( $styles[ $property ] ) ) {
		return false;
	}

	$resolved = $this->resolve_style_value( $styles[ $property ] );
	if ( ! $resolved ) {
		return false;
	}

	$target[ $property ] = $processor ? $processor( $resolved ) : $resolved;
	return true;
}