11<?php
2-
32/**
43 * REST API: WP_REST_Icons_Controller class
54 *
@@ -22,6 +21,8 @@ class WP_REST_Icons_Controller extends WP_REST_Controller {
2221
2322 /**
2423 * Constructs the controller.
24+ *
25+ * @since 7.0.0
2526 */
2627 public function __construct () {
2728 $ this ->namespace = 'wp/v2 ' ;
@@ -30,6 +31,8 @@ public function __construct() {
3031
3132 /**
3233 * Registers the routes for the objects of the controller.
34+ *
35+ * @since 7.0.0
3336 */
3437 public function register_routes () {
3538 register_rest_route (
@@ -72,6 +75,8 @@ public function register_routes() {
7275 /**
7376 * Checks whether a given request has permission to read icons.
7477 *
78+ * @since 7.0.0
79+ *
7580 * @param WP_REST_Request $request Full details about the request.
7681 * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
7782 */
@@ -99,6 +104,8 @@ public function get_items_permissions_check(
99104 /**
100105 * Checks if a given request has access to read a specific icon.
101106 *
107+ * @since 7.0.0
108+ *
102109 * @param WP_REST_Request $request Full details about the request.
103110 * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
104111 */
@@ -114,6 +121,8 @@ public function get_item_permissions_check( $request ) {
114121 /**
115122 * Retrieves all icons.
116123 *
124+ * @since 7.0.0
125+ *
117126 * @param WP_REST_Request $request Full details about the request.
118127 * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
119128 */
@@ -131,6 +140,8 @@ public function get_items( $request ) {
131140 /**
132141 * Retrieves a specific icon.
133142 *
143+ * @since 7.0.0
144+ *
134145 * @param WP_REST_Request $request Full details about the request.
135146 * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
136147 */
@@ -147,6 +158,8 @@ public function get_item( $request ) {
147158 /**
148159 * Retrieves a specific icon from the registry.
149160 *
161+ * @since 7.0.0
162+ *
150163 * @param string $name Icon name.
151164 * @return array|WP_Error Icon data on success, or WP_Error object on failure.
152165 */
@@ -172,6 +185,8 @@ public function get_icon( $name ) {
172185 /**
173186 * Prepare a raw icon before it gets output in a REST API response.
174187 *
188+ * @since 7.0.0
189+ *
175190 * @param array $item Raw icon as registered, before any changes.
176191 * @param WP_REST_Request $request Request object.
177192 * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
@@ -199,6 +214,8 @@ public function prepare_item_for_response( $item, $request ) {
199214 /**
200215 * Retrieves the icon schema, conforming to JSON Schema.
201216 *
217+ * @since 7.0.0
218+ *
202219 * @return array Item schema data.
203220 */
204221 public function get_item_schema () {
@@ -240,6 +257,8 @@ public function get_item_schema() {
240257 /**
241258 * Retrieves the query params for the icons collection.
242259 *
260+ * @since 7.0.0
261+ *
243262 * @return array Collection parameters.
244263 */
245264 public function get_collection_params () {
0 commit comments