WC_Abstract_Legacy_Product::build_related_query()protectedWC 1.0

Deprecated from version 3.0.0. It is no longer supported and can be removed in future releases. Use Product Data Store get_related_products_query instead.

Builds the related posts query.

Method of the class: WC_Abstract_Legacy_Product{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->build_related_query( $cats_array, $tags_array, $exclude_ids, $limit );
$cats_array (required)
-
$tags_array (required)
-
$exclude_ids (required)
-
$limit (required)
-

Changelog

Deprecated since 3.0.0 Use Product Data Store get_related_products_query instead.

WC_Abstract_Legacy_Product::build_related_query() code WC 8.7.0

protected function build_related_query( $cats_array, $tags_array, $exclude_ids, $limit ) {
	wc_deprecated_function( 'WC_Product::build_related_query', '3.0', 'Product Data Store get_related_products_query' );
	$data_store = WC_Data_Store::load( 'product' );
	return $data_store->get_related_products_query( $cats_array, $tags_array, $exclude_ids, $limit );
}