Automattic\WooCommerce\EmailEditor\Integrations\Utils

Styles_Helper::extend_block_styles │ public static │ WC 1.0

Extend block styles with CSS declarations.

Метод класса: Styles_Helper{}

Хуков нет.

Возвращает

array.

Использование

$result = Styles_Helper::extend_block_styles( $block_styles, $css_declarations );
$block_styles(массив) (обязательный)
WP_Style_Engine styles array (must contain 'declarations' and 'css' keys).
$css_declarations(массив) (обязательный)
An associative array of CSS definitions, e.g. array( "$property" => "$value", "$property" => "$value" ).

Код Styles_Helper::extend_block_styles() WC 11.2.1

public static function extend_block_styles( array $block_styles, array $css_declarations ) {
	// Ensure block_styles has the required WP_Style_Engine structure.
	if ( ! isset( $block_styles['declarations'] ) || ! is_array( $block_styles['declarations'] ) ) {
		$block_styles = self::$empty_block_styles;
	}

	$block_styles['declarations'] = array_merge( $block_styles['declarations'], $css_declarations );
	$block_styles['css']          = WP_Style_Engine::compile_css( $block_styles['declarations'], '' );

	return $block_styles;
}