WordPress at Your Fingertips
function is not described

WC_Abstract_Legacy_Product::build_related_query() protected WC 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.

{} It's a method of the class: WC_Abstract_Legacy_Product{}

No Hooks.

Return

null. Nothing.

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.

Code of WC_Abstract_Legacy_Product::build_related_query() WC 5.7.1

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 );
}