Automattic\WooCommerce\EmailEditor\Engine
Site_Style_Sync_Controller::resolve_and_assign
Resolve and assign a single style property
Метод класса: Site_Style_Sync_Controller{}
Хуков нет.
Возвращает
bool. True if the property was resolved and assigned, false otherwise.
Использование
// private - только в коде основоного (родительского) класса $result = $this->resolve_and_assign( $styles, $property, $target, ?callable $processor ): bool;
- $styles(массив) (обязательный)
- The source styles array.
- $property(строка) (обязательный)
- The property key to resolve.
- $target(массив) (обязательный)
- The target array to assign the value to.
- ?callable $processor
- .
По умолчанию:null
Код Site_Style_Sync_Controller::resolve_and_assign() Site Style Sync Controller::resolve and assign WC 11.2.2
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;
}