Automattic\WooCommerce\Internal\Admin\EmailPreview

EmailPreview::set_up_filters()privateWC 1.0

Set up filters for email preview.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

// private - только в коде основоного (родительского) класса
$result = $this->set_up_filters();

Код EmailPreview::set_up_filters() WC 9.6.1

private function set_up_filters() {
	// Always show shipping address in the preview email.
	add_filter( 'woocommerce_order_needs_shipping_address', array( $this, 'enable_shipping_address' ) );
	// Email templates fetch product from the database to show additional information, which are not
	// saved in WC_Order_Item_Product. This filter enables fetching that data also in email preview.
	add_filter( 'woocommerce_order_item_product', array( $this, 'get_dummy_product_when_not_set' ), 10, 1 );
	// Enable email preview mode - this way transient values are fetched for live preview.
	add_filter( 'woocommerce_is_email_preview', array( $this, 'enable_preview_mode' ) );
}