woocommerce_product_related_posts_force_display filter-hookWC 1.0

Don't bother if none are set, unless woocommerce_product_related_posts_force_display is set to true in which case all products are related.

Usage

add_filter( 'woocommerce_product_related_posts_force_display', 'wp_kama_woocommerce_product_related_posts_force_display_filter', 10, 2 );

/**
 * Function for `woocommerce_product_related_posts_force_display` filter-hook.
 * 
 * @param  $false      
 * @param  $product_id 
 *
 * @return 
 */
function wp_kama_woocommerce_product_related_posts_force_display_filter( $false, $product_id ){

	// filter...
	return $false;
}
$false
-
$product_id
-

Where the hook is called

wc_get_related_products()
woocommerce_product_related_posts_force_display
woocommerce/includes/wc-product-functions.php 958
if ( empty( $cats_array ) && empty( $tags_array ) && ! apply_filters( 'woocommerce_product_related_posts_force_display', false, $product_id ) ) {

Where the hook is used in WooCommerce

Usage not found.