Automattic\WooCommerce\Blocks\BlockTypes

AbstractBlock::parse_render_callback_attributes()protectedWC 1.0

Parses block attributes from the render_callback.

Method of the class: AbstractBlock{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->parse_render_callback_attributes( $attributes );
$attributes(array|WP_Block) (required)
Block attributes, or an instance of a WP_Block.
Default: an empty array

AbstractBlock::parse_render_callback_attributes() code WC 9.4.2

protected function parse_render_callback_attributes( $attributes ) {
	return is_a( $attributes, 'WP_Block' ) ? $attributes->attributes : $attributes;
}