WP_REST_Widgets_Controller::get_collection_params() WordPress Method

The WP_REST_Widgets_Controller::get_collection_params() method allows developers to specify the parameters that will be used when querying widget collections. This is useful for specifying which fields should be included in the response, or for pagination parameters.

WP_REST_Widgets_Controller::get_collection_params() #

Gets the list of collection params.


Return

(array[])


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php

	public function get_collection_params() {
		return array(
			'context' => $this->get_context_param( array( 'default' => 'view' ) ),
			'sidebar' => array(
				'description' => __( 'The sidebar to return widgets for.' ),
				'type'        => 'string',
			),
		);
	}


Top ↑

Changelog

Changelog
VersionDescription
5.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.