Title: WP_REST_Icons_Controller::get_item
Published: May 20, 2026

---

# WP_REST_Icons_Controller::get_item( WP_REST_Request $request ): 󠀁[WP_REST_Response](https://developer.wordpress.org/reference/classes/wp_rest_response/)󠁿|󠀁[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)󠁿

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_item/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_item/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_item/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_item/?output_format=md#related)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_item/?output_format=md#wp--skip-link--target)

Retrieves a specific icon.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_item/?output_format=md#parameters)󠁿

 `$request`[WP_REST_Request](https://developer.wordpress.org/reference/classes/wp_rest_request/)
required

Full details about the request.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_item/?output_format=md#return)󠁿

 [WP_REST_Response](https://developer.wordpress.org/reference/classes/wp_rest_response/)
|[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/) Response
object on success, or [WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)
object on failure.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_item/?output_format=md#source)󠁿

    ```php
    public function get_item( $request ) {
    	$icon = $this->get_icon( $request['name'] );
    	if ( is_wp_error( $icon ) ) {
    		return $icon;
    	}

    	$data = $this->prepare_item_for_response( $icon, $request );
    	return rest_ensure_response( $data );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-icons-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-icons-controller.php#L137)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-icons-controller.php#L137-L145)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_item/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_REST_Icons_Controller::get_icon()](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_icon/)`wp-includes/rest-api/endpoints/class-wp-rest-icons-controller.php` |

Retrieves a specific icon from the registry.

  | 
| [WP_REST_Icons_Controller::prepare_item_for_response()](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/prepare_item_for_response/)`wp-includes/rest-api/endpoints/class-wp-rest-icons-controller.php` |

Prepare a raw icon before it gets output in a REST API response.

  | 
| [rest_ensure_response()](https://developer.wordpress.org/reference/functions/rest_ensure_response/)`wp-includes/rest-api.php` |

Ensures a REST response is a response object (for consistency).

  | 
| [is_wp_error()](https://developer.wordpress.org/reference/functions/is_wp_error/)`wp-includes/load.php` |

Checks whether the given variable is a WordPress Error.

  |

[Show 2 more](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_item/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_item/?output_format=md#)

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_rest_icons_controller%2Fget_item%2F)
before being able to contribute a note or feedback.