woocommerce_shortcode_product_page_force_rendering filter-hookWC 8.6.0

Filters whether to override read permissions for unpublished products.

Usage

add_filter( 'woocommerce_shortcode_product_page_force_rendering', 'wp_kama_woocommerce_shortcode_product_page_force_rendering_filter', 10, 2 );

/**
 * Function for `woocommerce_shortcode_product_page_force_rendering` filter-hook.
 * 
 * @param bool $force_rendering Whether to override read permissions for unpublished products. `true` to force rendering the product page, `false` to block rendering, or `null` to use the default behavior.
 * @param int  $product_id      Product ID.
 *
 * @return bool
 */
function wp_kama_woocommerce_shortcode_product_page_force_rendering_filter( $force_rendering, $product_id ){

	// filter...
	return $force_rendering;
}
$force_rendering(true|false)
Whether to override read permissions for unpublished products. true to force rendering the product page, false to block rendering, or null to use the default behavior.
$product_id(int)
Product ID.

Changelog

Since 8.6.0 Introduced.

Where the hook is called

WC_Shortcodes::product_page()
woocommerce_shortcode_product_page_force_rendering
woocommerce/includes/class-wc-shortcodes.php 541
$force_rendering = apply_filters( 'woocommerce_shortcode_product_page_force_rendering', null, $product_id );

Where the hook is used in WooCommerce

Usage not found.