WP_REST_Plugins_Controller::get_collection_params() WordPress Method

The WP_REST_Plugins_Controller::get_collection_params() method is used to retrieve the collection parameters for the plugins controller.

WP_REST_Plugins_Controller::get_collection_params() #

Retrieves the query params for the collections.


Return

(array) Query parameters for the collection.


Top ↑

Source

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

	public function get_collection_params() {
		$query_params = parent::get_collection_params();

		$query_params['context']['default'] = 'view';

		$query_params['status'] = array(
			'description' => __( 'Limits results to plugins with the given status.' ),
			'type'        => 'array',
			'items'       => array(
				'type' => 'string',
				'enum' => is_multisite() ? array( 'inactive', 'active', 'network-active' ) : array( 'inactive', 'active' ),
			),
		);

		unset( $query_params['page'], $query_params['per_page'] );

		return $query_params;
	}


Top ↑

Changelog

Changelog
VersionDescription
5.5.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.