WordPress at Your Fingertips
function is not described

WC_Abstract_Legacy_Product::get_related() public WC 1.0

Deprecated from version 3.0.0. It is no longer supported and can be removed in future releases. Use wc_get_related_products instead.

Get and return related products.

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

No Hooks.

Return

Array.

Usage

$WC_Abstract_Legacy_Product = new WC_Abstract_Legacy_Product();
$WC_Abstract_Legacy_Product->get_related( $limit );
$limit(int)
-
Default: 5

Changelog

Deprecated Since 3.0.0 Use wc_get_related_products instead.

Code of WC_Abstract_Legacy_Product::get_related() WC 5.7.1

public function get_related( $limit = 5 ) {
	wc_deprecated_function( 'WC_Product::get_related', '3.0', 'wc_get_related_products' );
	return wc_get_related_products( $this->get_id(), $limit );
}