Title: WP_REST_Response::get_matched_handler
Published: December 9, 2015
Last modified: February 24, 2026

---

# WP_REST_Response::get_matched_handler(): null|array

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_rest_response/get_matched_handler/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_response/get_matched_handler/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_response/get_matched_handler/?output_format=md#changelog)

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

Retrieves the handler that was used to generate the response.

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

 null|array The handler that was used to create the response.

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

    ```php
    public function get_matched_handler() {
    	return $this->matched_handler;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-response.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/rest-api/class-wp-rest-response.php#L192)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/rest-api/class-wp-rest-response.php#L192-L194)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_rest_response/get_matched_handler/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |

## User Contributed Notes

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