WC_Abstract_Legacy_Product::get_matching_variation()publicWC 1.0

Устарела с версии 3.0.0 in favour of Product data store's find_matching_product_variation.. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.

Match a variation to a given set of attributes using a WP_Query.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$WC_Abstract_Legacy_Product = new WC_Abstract_Legacy_Product();
$WC_Abstract_Legacy_Product->get_matching_variation( $match_attributes );
$match_attributes(массив)
-
По умолчанию: array()

Список изменений

Устарела с 3.0.0 in favour of Product data store's find_matching_product_variation.

Код WC_Abstract_Legacy_Product::get_matching_variation() WC 8.7.0

public function get_matching_variation( $match_attributes = array() ) {
	wc_deprecated_function( 'WC_Product::get_matching_variation', '3.0', 'Product data store find_matching_product_variation' );
	$data_store = WC_Data_Store::load( 'product' );
	return $data_store->find_matching_product_variation( $this, $match_attributes );
}