WordPress at Your Fingertips
function is not described

WC_Product_Variable::child_has_weight() public WC 1.0

Does a child have a weight set?

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

No Hooks.

Return

true|false.

Usage

$WC_Product_Variable = new WC_Product_Variable();
$WC_Product_Variable->child_has_weight();

Code of WC_Product_Variable::child_has_weight() WC 5.8.0

public function child_has_weight() {
	$transient_name = 'wc_child_has_weight_' . $this->get_id();
	$has_weight     = get_transient( $transient_name );

	if ( false === $has_weight ) {
		$has_weight = $this->data_store->child_has_weight( $this );
		set_transient( $transient_name, (int) $has_weight, DAY_IN_SECONDS * 30 );
	}

	return (bool) $has_weight;
}