WordPress at Your Fingertips
function is not described

WP_REST_Terms_Controller::get_item() public WP 4.7.0

Gets a single term from a taxonomy.

{} It's a method of the class: WP_REST_Terms_Controller{}

No Hooks.


WP_REST_Response|WP_Error. Response object on success, or WP_Error object on failure.


$WP_REST_Terms_Controller = new WP_REST_Terms_Controller();
$WP_REST_Terms_Controller->get_item( $request );
$request(WP_REST_Request) (required)
Full details about the request.


Since 4.7.0 Introduced.

Code of WP_REST_Terms_Controller::get_item() WP 5.8

public function get_item( $request ) {
	$term = $this->get_term( $request['id'] );
	if ( is_wp_error( $term ) ) {
		return $term;

	$response = $this->prepare_item_for_response( $term, $request );

	return rest_ensure_response( $response );