woocommerce_email_preview_dummy_product
A dummy WC_Product used in email preview.
Использование
add_filter( 'woocommerce_email_preview_dummy_product', 'wp_kama_woocommerce_email_preview_dummy_product_filter', 10, 2 );
/**
* Function for `woocommerce_email_preview_dummy_product` filter-hook.
*
* @param WC_Product $product The dummy product object.
* @param string $email_type The email type to preview.
*
* @return WC_Product
*/
function wp_kama_woocommerce_email_preview_dummy_product_filter( $product, $email_type ){
// filter...
return $product;
}
- $product(WC_Product)
- The dummy product object.
- $email_type(строка)
- The email type to preview.
Список изменений
| С версии 9.6.0 | Введена. |
Где вызывается хук
woocommerce_email_preview_dummy_product
woocommerce/src/Internal/Admin/EmailPreview/EmailPreview.php 507
return apply_filters( 'woocommerce_email_preview_dummy_product', $product, $this->email_type );