WC_Product_Variable::child_has_weight()publicWC 1.0

Does a child have a weight set?

Метод класса: WC_Product_Variable{}

Хуков нет.

Возвращает

true|false.

Использование

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

Код WC_Product_Variable::child_has_weight() WC 8.7.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;
}