WC_Product_Variable::get_children()publicWC 1.0

Return a products child ids.

This is lazy loaded as it's not used often and does require several queries.

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

Хуки из метода

Возвращает

Массив. Children ids

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

$WC_Product_Variable = new WC_Product_Variable();
$WC_Product_Variable->get_children( $visible_only );
$visible_only(true|false|строка)
Visible only.
По умолчанию: ''

Код WC_Product_Variable::get_children() WC 9.3.3

public function get_children( $visible_only = '' ) {
	if ( is_bool( $visible_only ) ) {
		wc_deprecated_argument( 'visible_only', '3.0', 'WC_Product_Variable::get_visible_children' );

		return $visible_only ? $this->get_visible_children() : $this->get_children();
	}

	if ( null === $this->children ) {
		$children = $this->data_store->read_children( $this );
		$this->set_children( $children['all'] );
		$this->set_visible_children( $children['visible'] );
	}

	return apply_filters( 'woocommerce_get_children', $this->children, $this, false );
}