diff --git a/src/api/class-tainacan-rest-controller.php b/src/api/class-tainacan-rest-controller.php index 966e87c7a..6e7a9c95e 100644 --- a/src/api/class-tainacan-rest-controller.php +++ b/src/api/class-tainacan-rest-controller.php @@ -286,11 +286,18 @@ class REST_Controller extends \WP_REST_Controller { * @return array|void */ public function get_wp_query_params(){ + $query_params['id'] = array( 'description' => __("Limit result to objects with specific id.", 'tainacan'), 'type' => 'integer', ); + $query_params['context'] = array( + 'type' => 'string', + 'default' => 'view', + 'items' => array( 'view, edit' ) + ); + $query_params['search'] = array( 'description' => __( 'Limit results to those matching a string.', 'tainacan' ), 'type' => 'string', diff --git a/src/api/endpoints/class-tainacan-rest-collections-controller.php b/src/api/endpoints/class-tainacan-rest-collections-controller.php index b4aef0ef0..c93f209ee 100644 --- a/src/api/endpoints/class-tainacan-rest-collections-controller.php +++ b/src/api/endpoints/class-tainacan-rest-collections-controller.php @@ -478,12 +478,6 @@ class REST_Collections_Controller extends REST_Controller { $endpoint_args = []; if($method === \WP_REST_Server::READABLE) { - $endpoint_args['context'] = array( - 'type' => 'string', - 'default' => 'view', - 'items' => array( 'view, edit' ) - ); - $endpoint_args['name'] = array( 'description' => __('Limits the result set to collections with a specific name'), 'type' => 'string', diff --git a/src/api/endpoints/class-tainacan-rest-filters-controller.php b/src/api/endpoints/class-tainacan-rest-filters-controller.php index 03685c6f2..5277e3416 100644 --- a/src/api/endpoints/class-tainacan-rest-filters-controller.php +++ b/src/api/endpoints/class-tainacan-rest-filters-controller.php @@ -469,11 +469,6 @@ class REST_Filters_Controller extends REST_Controller { public function get_endpoint_args_for_item_schema( $method = null ) { $endpoint_args = []; if($method === \WP_REST_Server::READABLE) { - $endpoint_args['context'] = array( - 'type' => 'string', - 'default' => 'view', - 'items' => array( 'view, edit' ) - ); $endpoint_args = array_merge( $endpoint_args, parent::get_wp_query_params() diff --git a/src/api/endpoints/class-tainacan-rest-item-metadata-controller.php b/src/api/endpoints/class-tainacan-rest-item-metadata-controller.php index f0b214f98..491e6b5ea 100644 --- a/src/api/endpoints/class-tainacan-rest-item-metadata-controller.php +++ b/src/api/endpoints/class-tainacan-rest-item-metadata-controller.php @@ -269,11 +269,6 @@ class REST_Item_Metadata_Controller extends REST_Controller { $endpoint_args = []; if($method === \WP_REST_Server::READABLE) { - $endpoint_args['context'] = array( - 'type' => 'string', - 'default' => 'view', - 'items' => array( 'view, edit' ) - ); $endpoint_args = array_merge( $endpoint_args, parent::get_wp_query_params() diff --git a/src/api/endpoints/class-tainacan-rest-items-controller.php b/src/api/endpoints/class-tainacan-rest-items-controller.php index 9d06a0cfa..1f126663c 100644 --- a/src/api/endpoints/class-tainacan-rest-items-controller.php +++ b/src/api/endpoints/class-tainacan-rest-items-controller.php @@ -761,12 +761,6 @@ class REST_Items_Controller extends REST_Controller { 'type' => 'string/array', 'description' => __( 'Fetch only specific attribute. The specifics attributes are the same in schema.' ), ); - - $endpoint_args['context'] = array( - 'type' => 'string', - 'default' => 'view', - 'items' => array( 'view, edit' ) - ); } elseif ($method === \WP_REST_Server::CREATABLE || $method === \WP_REST_Server::EDITABLE) { $map = $this->items_repository->get_map(); diff --git a/src/api/endpoints/class-tainacan-rest-logs-controller.php b/src/api/endpoints/class-tainacan-rest-logs-controller.php index f30a4ca0d..2cd7a94a4 100644 --- a/src/api/endpoints/class-tainacan-rest-logs-controller.php +++ b/src/api/endpoints/class-tainacan-rest-logs-controller.php @@ -351,11 +351,6 @@ class REST_Logs_Controller extends REST_Controller { public function get_endpoint_args_for_item_schema( $method = null ) { $endpoint_args = []; if($method === \WP_REST_Server::READABLE) { - $endpoint_args['context'] = array( - 'type' => 'string', - 'default' => 'view', - 'items' => array( 'view' ) - ); $endpoint_args = array_merge( $endpoint_args, parent::get_wp_query_params() diff --git a/src/api/endpoints/class-tainacan-rest-metadata-controller.php b/src/api/endpoints/class-tainacan-rest-metadata-controller.php index 463d3320c..a85bf6c74 100644 --- a/src/api/endpoints/class-tainacan-rest-metadata-controller.php +++ b/src/api/endpoints/class-tainacan-rest-metadata-controller.php @@ -564,11 +564,6 @@ class REST_Metadata_Controller extends REST_Controller { public function get_endpoint_args_for_item_schema( $method = null ) { $endpoint_args = []; if($method === \WP_REST_Server::READABLE) { - $endpoint_args['context'] = array( - 'type' => 'string', - 'default' => 'view', - 'items' => array( 'view, edit' ) - ); $endpoint_args = array_merge( $endpoint_args, parent::get_wp_query_params() diff --git a/src/api/endpoints/class-tainacan-rest-taxonomies-controller.php b/src/api/endpoints/class-tainacan-rest-taxonomies-controller.php index 061386506..457cd016f 100644 --- a/src/api/endpoints/class-tainacan-rest-taxonomies-controller.php +++ b/src/api/endpoints/class-tainacan-rest-taxonomies-controller.php @@ -452,11 +452,6 @@ class REST_Taxonomies_Controller extends REST_Controller { public function get_endpoint_args_for_item_schema( $method = null ) { $endpoint_args = []; if($method === \WP_REST_Server::READABLE) { - $endpoint_args['context'] = array( - 'type' => 'string', - 'default' => 'view', - 'items' => array( 'view, edit' ) - ); $endpoint_args = array_merge( $endpoint_args, parent::get_wp_query_params(), diff --git a/src/api/endpoints/class-tainacan-rest-terms-controller.php b/src/api/endpoints/class-tainacan-rest-terms-controller.php index db4ff4c8e..dea5906c2 100644 --- a/src/api/endpoints/class-tainacan-rest-terms-controller.php +++ b/src/api/endpoints/class-tainacan-rest-terms-controller.php @@ -420,11 +420,6 @@ class REST_Terms_Controller extends REST_Controller { public function get_endpoint_args_for_item_schema( $method = null ) { $endpoint_args = []; if($method === \WP_REST_Server::READABLE) { - $endpoint_args['context'] = array( - 'type' => 'string', - 'default' => 'view', - 'items' => array( 'view, edit' ) - ); $endpoint_args = array_merge( $endpoint_args, parent::get_wp_query_params()