WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Admin\API\Reports

DataStore::get_included_products_array() protected WC 1.0

Returns an array of ids of allowed products, based on query arguments from the user.

{} Это метод класса: DataStore{}

Хуков нет.

Возвращает

Массив.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_included_products_array( $query_args );
$query_args(массив) (обязательный)
Parameters supplied by the user.

Код DataStore::get_included_products_array() WC 4.7.1

<?php
protected function get_included_products_array( $query_args ) {
	$included_products = array();
	$operator          = $this->get_match_operator( $query_args );

	if ( isset( $query_args['categories'] ) && is_array( $query_args['categories'] ) && count( $query_args['categories'] ) > 0 ) {
		$included_products = $this->get_products_by_cat_ids( $query_args['categories'] );
		$included_products = empty( $included_products ) ? array( '-1' ) : wc_list_pluck( $included_products, 'get_id' );
	}

	if ( isset( $query_args['product_includes'] ) && is_array( $query_args['product_includes'] ) && count( $query_args['product_includes'] ) > 0 ) {
		if ( count( $included_products ) > 0 ) {
			if ( 'AND' === $operator ) {
				$included_products = array_intersect( $included_products, $query_args['product_includes'] );
			} elseif ( 'OR' === $operator ) {
				// Union of products from selected categories and manually included products.
				$included_products = array_unique( array_merge( $included_products, $query_args['product_includes'] ) );
			}
		} else {
			$included_products = $query_args['product_includes'];
		}
	}

	return $included_products;
}