@@ -11,7 +11,7 @@ public function register_routes() {
1111 }
1212
1313 /**
14- * Get a collection of items
14+ * Get a collection of items.
1515 *
1616 * @param WP_REST_Request $request Full data about the request.
1717 * @return WP_Error|WP_REST_Response
@@ -21,7 +21,7 @@ public function get_items( $request ) {
2121 }
2222
2323 /**
24- * Get one item from the collection
24+ * Get one item from the collection.
2525 *
2626 * @param WP_REST_Request $request Full data about the request.
2727 * @return WP_Error|WP_REST_Response
@@ -31,7 +31,7 @@ public function get_item( $request ) {
3131 }
3232
3333 /**
34- * Create one item from the collection
34+ * Create one item from the collection.
3535 *
3636 * @param WP_REST_Request $request Full data about the request.
3737 * @return WP_Error|WP_REST_Response
@@ -41,7 +41,7 @@ public function create_item( $request ) {
4141 }
4242
4343 /**
44- * Update one item from the collection
44+ * Update one item from the collection.
4545 *
4646 * @param WP_REST_Request $request Full data about the request.
4747 * @return WP_Error|WP_REST_Response
@@ -51,7 +51,7 @@ public function update_item( $request ) {
5151 }
5252
5353 /**
54- * Delete one item from the collection
54+ * Delete one item from the collection.
5555 *
5656 * @param WP_REST_Request $request Full data about the request.
5757 * @return WP_Error|WP_REST_Response
@@ -61,7 +61,7 @@ public function delete_item( $request ) {
6161 }
6262
6363 /**
64- * Check if a given request has access to get items
64+ * Check if a given request has access to get items.
6565 *
6666 * @param WP_REST_Request $request Full data about the request.
6767 * @return WP_Error|bool
@@ -71,7 +71,7 @@ public function get_items_permissions_check( $request ) {
7171 }
7272
7373 /**
74- * Check if a given request has access to get a specific item
74+ * Check if a given request has access to get a specific item.
7575 *
7676 * @param WP_REST_Request $request Full data about the request.
7777 * @return WP_Error|bool
@@ -81,7 +81,7 @@ public function get_item_permissions_check( $request ) {
8181 }
8282
8383 /**
84- * Check if a given request has access to create items
84+ * Check if a given request has access to create items.
8585 *
8686 * @param WP_REST_Request $request Full data about the request.
8787 * @return WP_Error|bool
@@ -91,7 +91,7 @@ public function create_item_permissions_check( $request ) {
9191 }
9292
9393 /**
94- * Check if a given request has access to update a specific item
94+ * Check if a given request has access to update a specific item.
9595 *
9696 * @param WP_REST_Request $request Full data about the request.
9797 * @return WP_Error|bool
@@ -101,7 +101,7 @@ public function update_item_permissions_check( $request ) {
101101 }
102102
103103 /**
104- * Check if a given request has access to delete a specific item
104+ * Check if a given request has access to delete a specific item.
105105 *
106106 * @param WP_REST_Request $request Full data about the request.
107107 * @return WP_Error|bool
@@ -111,17 +111,17 @@ public function delete_item_permissions_check( $request ) {
111111 }
112112
113113 /**
114- * Prepare the item for create or update operation
114+ * Prepare the item for create or update operation.
115115 *
116- * @param WP_REST_Request $request Request object
116+ * @param WP_REST_Request $request Request object.
117117 * @return WP_Error|object $prepared_item
118118 */
119119 protected function prepare_item_for_database ( $ request ) {
120120 return new WP_Error ( 'invalid-method ' , sprintf ( __ ( "Method '%s' not implemented. Must be over-ridden in subclass. " ), __METHOD__ ), array ( 'status ' => 405 ) );
121121 }
122122
123123 /**
124- * Prepare the item for the REST response
124+ * Prepare the item for the REST response.
125125 *
126126 * @param mixed $item WordPress representation of the item.
127127 * @param WP_REST_Request $request Request object.
@@ -152,7 +152,7 @@ public function prepare_response_for_collection( $response ) {
152152 }
153153
154154 /**
155- * Filter a response based on the context defined in the schema
155+ * Filter a response based on the context defined in the schema.
156156 *
157157 * @param array $data
158158 * @param string $context
@@ -186,7 +186,7 @@ public function filter_response_by_context( $data, $context ) {
186186 }
187187
188188 /**
189- * Get the item's schema, conforming to JSON Schema
189+ * Get the item's schema, conforming to JSON Schema.
190190 *
191191 * @return array
192192 */
@@ -213,7 +213,7 @@ public function get_public_item_schema() {
213213 }
214214
215215 /**
216- * Get the query params for collections
216+ * Get the query params for collections.
217217 *
218218 * @return array
219219 */
@@ -240,11 +240,11 @@ public function get_collection_params() {
240240 }
241241
242242 /**
243- * Add the values from additional fields to a data object
243+ * Add the values from additional fields to a data object.
244244 *
245245 * @param array $object
246246 * @param WP_REST_Request $request
247- * @return array modified object with additional fields
247+ * @return array modified object with additional fields.
248248 */
249249 protected function add_additional_fields_to_object ( $ object , $ request ) {
250250
@@ -278,7 +278,7 @@ protected function update_additional_fields_for_object( $object, $request ) {
278278 continue ;
279279 }
280280
281- // Don't run the update callbacks if the data wasn't passed in the request
281+ // Don't run the update callbacks if the data wasn't passed in the request.
282282 if ( ! isset ( $ request [ $ field_name ] ) ) {
283283 continue ;
284284 }
@@ -288,19 +288,19 @@ protected function update_additional_fields_for_object( $object, $request ) {
288288 }
289289
290290 /**
291- * Add the schema from additional fields to an schema array
291+ * Add the schema from additional fields to an schema array.
292292 *
293293 * The type of object is inferred from the passed schema.
294294 *
295- * @param array $schema Schema array
295+ * @param array $schema Schema array.
296296 */
297297 protected function add_additional_fields_schema ( $ schema ) {
298298 if ( ! $ schema || ! isset ( $ schema ['title ' ] ) ) {
299299 return $ schema ;
300300 }
301301
302302 /**
303- * Can't use $this->get_object_type otherwise we cause an inf loop
303+ * Can't use $this->get_object_type otherwise we cause an inf loop.
304304 */
305305 $ object_type = $ schema ['title ' ];
306306
@@ -318,7 +318,7 @@ protected function add_additional_fields_schema( $schema ) {
318318 }
319319
320320 /**
321- * Get all the registered additional fields for a given object-type
321+ * Get all the registered additional fields for a given object-type.
322322 *
323323 * @param string $object_type
324324 * @return array
@@ -497,7 +497,7 @@ public function sanitize_schema_property( $value, $request, $parameter ) {
497497
498498 case 'email ' :
499499 // as sanitize_email is very lossy, we just want to
500- // make sure the string is safe
500+ // make sure the string is safe.
501501 if ( sanitize_email ( $ value ) ) {
502502 return sanitize_email ( $ value );
503503 }
0 commit comments