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

Product_Image::parse_attributes │ private │ WC 1.0

Parse block attributes with defaults.

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

Хуков нет.

Возвращает

array.

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

// private - только в коде основоного (родительского) класса
$result = $this->parse_attributes( $attributes ): array;
$attributes(массив) (обязательный)
Block attributes.

Код Product_Image::parse_attributes() WC 11.2.2

private function parse_attributes( array $attributes ): array {
	return wp_parse_args(
		$attributes,
		array(
			'showProductLink' => true,
			'imageSizing'     => 'single',
			'scale'           => 'cover',
			'showSaleBadge'   => false,
			'saleBadgeAlign'  => 'right',
		)
	);
}