WP_REST_Terms_Controller::get_item()
Gets a single term from a taxonomy.
Method of the class: WP_REST_Terms_Controller{}
No Hooks.
Return
WP_REST_Response|WP_Error
. Response object on success, or WP_Error object on failure.
Usage
$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.
Changelog
Since 4.7.0 | Introduced. |
WP_REST_Terms_Controller::get_item() WP REST Terms Controller::get item code WP 6.6.2
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 ); }