Automattic\WooCommerce\Admin\Features\ProductBlockEditor

BlockRegistry::augment_attributes()privateWC 1.0

Augment the attributes of a block by adding attributes that are used by the product editor.

Method of the class: BlockRegistry{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->augment_attributes( $attributes );
$attributes(array) (required)
Block attributes.

BlockRegistry::augment_attributes() code WC 9.7.1

private function augment_attributes( $attributes ) {
	// Note: If you modify this function, also update the client-side
	// registerWooBlockType function in @woocommerce/block-templates.
	return array_merge(
		$attributes,
		array(
			'_templateBlockId'                => array(
				'type'               => 'string',
				'__experimentalRole' => 'content',
			),
			'_templateBlockOrder'             => array(
				'type'               => 'integer',
				'__experimentalRole' => 'content',
			),
			'_templateBlockHideConditions'    => array(
				'type'               => 'array',
				'__experimentalRole' => 'content',
			),
			'_templateBlockDisableConditions' => array(
				'type'               => 'array',
				'__experimentalRole' => 'content',
			),
			'disabled'                        => isset( $attributes['disabled'] ) ? $attributes['disabled'] : array(
				'type'               => 'boolean',
				'__experimentalRole' => 'content',
			),
		)
	);
}