MailPoet\EmailEditor\Integrations\Core\Renderer\Blocks

Abstract_Block_Renderer::get_styles_from_block()protectedWC 1.0

Wrapper for wp_style_engine_get_styles which ensures all values are returned.

Method of the class: Abstract_Block_Renderer{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_styles_from_block( $block_styles, $skip_convert_vars );
$block_styles(array) (required)
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.
Default: false

Abstract_Block_Renderer::get_styles_from_block() code WC 9.8.1

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'   => '',
		)
	);
}