Changeset 39031
- Timestamp:
- 10/30/2016 06:06:23 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
r38832 r39031 1 1 <?php 2 2 /** 3 * REST API: WP_REST_Taxonomies_Controller class 4 * 5 * @package WordPress 6 * @subpackage REST_API 7 * @since 4.7.0 8 */ 9 10 /** 11 * Core class used to manage taxonomies via the REST API. 12 * 13 * @since 4.7.0 14 * 15 * @see WP_REST_Controller 16 */ 3 17 class WP_REST_Taxonomies_Controller extends WP_REST_Controller { 4 18 19 /** 20 * Constructor. 21 * 22 * @since 4.7.0 23 * @access public 24 */ 5 25 public function __construct() { 6 26 $this->namespace = 'wp/v2'; … … 9 29 10 30 /** 11 * Register the routes for the objects of the controller. 31 * Registers the routes for the objects of the controller. 32 * 33 * @since 4.7.0 34 * @access public 35 * 36 * @see register_rest_route() 12 37 */ 13 38 public function register_routes() { … … 37 62 38 63 /** 39 * Check whether a given request has permission to read taxonomies. 40 * 41 * @param WP_REST_Request $request Full details about the request. 42 * @return WP_Error|boolean 64 * Checks whether a given request has permission to read taxonomies. 65 * 66 * @since 4.7.0 67 * @access public 68 * 69 * @param WP_REST_Request $request Full details about the request. 70 * @return true|WP_Error True if the request has read access, WP_Error object otherwise. 43 71 */ 44 72 public function get_items_permissions_check( $request ) { … … 60 88 61 89 /** 62 * Get all public taxonomies 63 * 64 * @param WP_REST_Request $request 65 * @return array 90 * Retrieves all public taxonomies. 91 * 92 * @since 4.7.0 93 * @access public 94 * 95 * @param WP_REST_Request $request Full details about the request. 96 * @return WP_REST_Response Response object on success, or WP_Error object on failure. 66 97 */ 67 98 public function get_items( $request ) { … … 94 125 95 126 /** 96 * Check if a given request has access a taxonomy 127 * Checks if a given request has access to a taxonomy. 128 * 129 * @since 4.7.0 130 * @access public 97 131 * 98 132 * @param WP_REST_Request $request Full details about the request. 99 * @return WP_Error|boolean133 * @return true|WP_Error True if the request has read access for the item, otherwise false or WP_Error object. 100 134 */ 101 135 public function get_item_permissions_check( $request ) { … … 116 150 117 151 /** 118 * Get a specific taxonomy 119 * 120 * @param WP_REST_Request $request 121 * @return array|WP_Error 152 * Retrieves a specific taxonomy. 153 * 154 * @since 4.7.0 155 * @access public 156 * 157 * @param WP_REST_Request $request Full details about the request. 158 * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. 122 159 */ 123 160 public function get_item( $request ) { … … 131 168 132 169 /** 133 * Prepare a taxonomy object for serialization 134 * 135 * @param stdClass $taxonomy Taxonomy data 136 * @param WP_REST_Request $request 137 * @return WP_REST_Response $response 170 * Prepares a taxonomy object for serialization. 171 * 172 * @since 4.7.0 173 * @access public 174 * 175 * @param stdClass $taxonomy Taxonomy data. 176 * @param WP_REST_Request $request Full details about the request. 177 * @return WP_REST_Response Response object. 138 178 */ 139 179 public function prepare_item_for_response( $taxonomy, $request ) { … … 168 208 169 209 /** 170 * Filter a taxonomy returned from theAPI.210 * Filters a taxonomy returned from the REST API. 171 211 * 172 212 * Allows modification of the taxonomy data right before it is returned. 173 213 * 174 * @param WP_REST_Response $response The response object. 175 * @param object $item The original taxonomy object. 176 * @param WP_REST_Request $request Request used to generate the response. 214 * @since 4.7.0 215 * 216 * @param WP_REST_Response $response The response object. 217 * @param object $item The original taxonomy object. 218 * @param WP_REST_Request $request Request used to generate the response. 177 219 */ 178 220 return apply_filters( 'rest_prepare_taxonomy', $response, $taxonomy, $request ); … … 180 222 181 223 /** 182 * Get the taxonomy's schema, conforming to JSON Schema 183 * 184 * @return array 224 * Retrieves the taxonomy's schema, conforming to JSON Schema. 225 * 226 * @since 4.7.0 227 * @access public 228 * 229 * @return array Item schema data. 185 230 */ 186 231 public function get_item_schema() { … … 244 289 245 290 /** 246 * Get the query params for collections 247 * 248 * @return array 291 * Retrieves the query params for collections. 292 * 293 * @since 4.7.0 294 * @access public 295 * 296 * @return array Collection parameters. 249 297 */ 250 298 public function get_collection_params() {
Note: See TracChangeset
for help on using the changeset viewer.