Automattic\WooCommerce\Blocks\BlockTypes

ProductRatingCounter::parse_attributesprivateWC 1.0

Get the block's attributes.

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

Хуков нет.

Возвращает

Массив. Block attributes merged with defaults.

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

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

Код ProductRatingCounter::parse_attributes() WC 9.9.4

private function parse_attributes( $attributes ) {
	// These should match what's set in JS `registerBlockType`.
	$defaults = array(
		'productId'                           => 0,
		'isDescendentOfQueryLoop'             => false,
		'textAlign'                           => '',
		'isDescendentOfSingleProductBlock'    => false,
		'isDescendentOfSingleProductTemplate' => false,
	);

	return wp_parse_args( $attributes, $defaults );
}