WordPress at Your Fingertips
function is not described

WC_Product::set_tax_class() public WC 3.0.0

Set the tax class.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Product = new WC_Product();
$WC_Product->set_tax_class( $class );
$class(string) (required)
Tax class.

Changelog

Since 3.0.0 Introduced.

Code of WC_Product::set_tax_class() WC 5.5.2

<?php
public function set_tax_class( $class ) {
	$class         = sanitize_title( $class );
	$class         = 'standard' === $class ? '' : $class;
	$valid_classes = $this->get_valid_tax_classes();

	if ( ! in_array( $class, $valid_classes, true ) ) {
		$class = '';
	}

	$this->set_prop( 'tax_class', $class );
}