Automattic\WooCommerce\Blocks\BlockTypes
ProductRatingCounter::parse_attributes
Get the block's attributes.
Method of the class: ProductRatingCounter{}
No Hooks.
Returns
Array. Block attributes merged with defaults.
Usage
// private - for code of main (parent) class only $result = $this->parse_attributes( $attributes );
- $attributes(array) (required)
- Block attributes.
Default:empty array
ProductRatingCounter::parse_attributes() ProductRatingCounter::parse attributes code WC 10.6.2
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 );
}