WP_REST_View_Config_Controller::get_grid_layout_schemaprotectedWP 7.1.0

Returns the layout schema for grid-type views (ViewGrid, ViewPickerGrid).

Method of the class: WP_REST_View_Config_Controller{}

No Hooks.

Returns

array. Schema for a grid layout object.

Usage

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

Changelog

Since 7.1.0 Introduced.

WP_REST_View_Config_Controller::get_grid_layout_schema() code WP 7.1

protected function get_grid_layout_schema() {
	return array(
		'type'       => 'object',
		'properties' => array(
			'badgeFields' => array(
				'type'  => 'array',
				'items' => array(
					'type' => 'string',
				),
			),
			'previewSize' => array(
				'type' => 'number',
			),
			'density'     => array(
				'type' => 'string',
				'enum' => array( 'compact', 'balanced', 'comfortable' ),
			),
		),
	);
}