WordPress at Your Fingertips
function is not described

WC_REST_Tax_Classes_V2_Controller::get_item() public WC 1.0

Get one tax class.

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

No Hooks.

Return

Array.

Usage

$WC_REST_Tax_Classes_V2_Controller = new WC_REST_Tax_Classes_V2_Controller();
$WC_REST_Tax_Classes_V2_Controller->get_item( $request );
$request(WP_REST_Request) (required)
Request object.

Code of WC_REST_Tax_Classes_V2_Controller::get_item() WC 5.9.0

public function get_item( $request ) {
	if ( 'standard' === $request['slug'] ) {
		$tax_class = array(
			'slug' => 'standard',
			'name' => __( 'Standard rate', 'woocommerce' ),
		);
	} else {
		$tax_class = WC_Tax::get_tax_class_by( 'slug', sanitize_title( $request['slug'] ) );
	}

	$data = array();
	if ( $tax_class ) {
		$class  = $this->prepare_item_for_response( $tax_class, $request );
		$class  = $this->prepare_response_for_collection( $class );
		$data[] = $class;
	}

	return rest_ensure_response( $data );
}