WordPress at Your Fingertips
function is not described

WC_Product::set_tax_status() public WC 3.0.0

Set the tax status.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Product = new WC_Product();
$WC_Product->set_tax_status( $status );
$status(string) (required)
Tax status.

Changelog

Since 3.0.0 Introduced.

Code of WC_Product::set_tax_status() WC 5.5.2

<?php
public function set_tax_status( $status ) {
	$options = array(
		'taxable',
		'shipping',
		'none',
	);

	// Set default if empty.
	if ( empty( $status ) ) {
		$status = 'taxable';
	}

	if ( ! in_array( $status, $options, true ) ) {
		$this->error( 'product_invalid_tax_status', __( 'Invalid product tax status.', 'woocommerce' ) );
	}

	$this->set_prop( 'tax_status', $status );
}