Automattic\WooCommerce\Blocks\BlockTypes
AddToCartForm::parse_attributes
Get the block's attributes.
Method of the class: AddToCartForm{}
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
AddToCartForm::parse_attributes() AddToCartForm::parse attributes code WC 10.3.3
private function parse_attributes( $attributes ) {
// These should match what's set in JS `registerBlockType`.
$defaults = array(
'quantitySelectorStyle' => 'input',
);
return wp_parse_args( $attributes, $defaults );
}