Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks

Abstract_Block_Renderer::get_styles_from_blockprotectedWC 1.0

Wrapper for wp_style_engine_get_styles which ensures all values are returned.

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

Хуков нет.

Возвращает

Массив.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_styles_from_block( $block_styles, $skip_convert_vars );
$block_styles(массив) (обязательный)
Array of block styles.
$skip_convert_vars(true|false)
If true, --wp_preset--spacing--x type values will be left in the original var:preset:spacing:x format.
По умолчанию: false

Код Abstract_Block_Renderer::get_styles_from_block() WC 10.0.2

protected function get_styles_from_block( array $block_styles, $skip_convert_vars = false ) {
	$styles = wp_style_engine_get_styles( $block_styles, array( 'convert_vars_to_classnames' => $skip_convert_vars ) );
	return wp_parse_args(
		$styles,
		array(
			'css'          => '',
			'declarations' => array(),
			'classnames'   => '',
		)
	);
}