Automattic\WooCommerce\Internal\Admin\EmailPreview

EmailPreview::force_product_downloadable │ public │ WC 1.0

Force products in preview to be considered downloadable so core renders downloads section.

Метод класса: EmailPreview{}

Хуки из метода

Возвращает

bool.

Использование

$EmailPreview = new EmailPreview();
$EmailPreview->force_product_downloadable( $is_downloadable );
$is_downloadable(true|false) (обязательный)
Current value.

Код EmailPreview::force_product_downloadable() WC 11.3.0

public function force_product_downloadable( $is_downloadable ) {
	/**
	 * Filters whether the current request is an email preview.
	 *
	 * When true, products should be considered downloadable so the downloads
	 * section renders in applicable emails during preview.
	 *
	 * @since 9.6.0
	 *
	 * @param bool $is_email_preview Whether preview mode is active.
	 */
	if ( apply_filters( 'woocommerce_is_email_preview', false ) ) {
		return true;
	}
	return $is_downloadable;
}