Automattic\WooCommerce\Blocks\BlockTypes

AbstractProductGrid::get_schema_orderby()protectedWC 1.0

Get the schema for the orderby attribute.

Method of the class: AbstractProductGrid{}

No Hooks.

Return

Array. Property definition of orderby attribute.

Usage

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

AbstractProductGrid::get_schema_orderby() code WC 9.4.2

protected function get_schema_orderby() {
	return array(
		'type'    => 'string',
		'enum'    => array( 'date', 'popularity', 'price_asc', 'price_desc', 'rating', 'title', 'menu_order' ),
		'default' => 'date',
	);
}