WordPress at Your Fingertips
function is not described

WC_REST_Tax_Classes_V1_Controller::get_items() public WC 1.0

Get all tax classes.

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

No Hooks.

Return

Array.

Usage

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

Code of WC_REST_Tax_Classes_V1_Controller::get_items() WC 5.9.0

public function get_items( $request ) {
	$tax_classes = array();

	// Add standard class.
	$tax_classes[] = array(
		'slug' => 'standard',
		'name' => __( 'Standard rate', 'woocommerce' ),
	);

	$classes = WC_Tax::get_tax_classes();

	foreach ( $classes as $class ) {
		$tax_classes[] = array(
			'slug' => sanitize_title( $class ),
			'name' => $class,
		);
	}

	$data = array();
	foreach ( $tax_classes as $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 );
}