woocommerce_related_products filter-hookWC 1.0

Usage

add_filter( 'woocommerce_related_products', 'wp_kama_woocommerce_related_products_filter', 10, 3 );

/**
 * Function for `woocommerce_related_products` filter-hook.
 * 
 * @param  $related_posts 
 * @param  $product_id    
 * @param  $array         
 *
 * @return 
 */
function wp_kama_woocommerce_related_products_filter( $related_posts, $product_id, $array ){

	// filter...
	return $related_posts;
}
$related_posts
-
$product_id
-
$array
-

Where the hook is called

wc_get_related_products()
woocommerce_related_products
woocommerce/includes/wc-product-functions.php 943-951
$related_posts = apply_filters(
	'woocommerce_related_products',
	$related_posts,
	$product_id,
	array(
		'limit'        => $limit,
		'excluded_ids' => $exclude_ids,
	)
);

Where the hook is used in WooCommerce

Usage not found.