Automattic\WooCommerce\Blocks\BlockTypes

AbstractProductGrid::get_block_type_attributes()protectedWC 1.0

Get a set of attributes shared across most of the grid blocks.

Method of the class: AbstractProductGrid{}

No Hooks.

Return

Array. List of block attributes with type and defaults.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_block_type_attributes();

AbstractProductGrid::get_block_type_attributes() code WC 8.7.0

protected function get_block_type_attributes() {
	return array(
		'className'         => $this->get_schema_string(),
		'columns'           => $this->get_schema_number( wc_get_theme_support( 'product_blocks::default_columns', 3 ) ),
		'rows'              => $this->get_schema_number( wc_get_theme_support( 'product_blocks::default_rows', 3 ) ),
		'categories'        => $this->get_schema_list_ids(),
		'catOperator'       => array(
			'type'    => 'string',
			'default' => 'any',
		),
		'contentVisibility' => $this->get_schema_content_visibility(),
		'align'             => $this->get_schema_align(),
		'alignButtons'      => $this->get_schema_boolean( false ),
		'isPreview'         => $this->get_schema_boolean( false ),
		'stockStatus'       => array(
			'type'    => 'array',
			'default' => array_keys( wc_get_product_stock_status_options() ),
		),
	);
}