woocommerce_prepare_email_for_preview
Allow to modify the email object before rendering the preview to add additional data.
Использование
add_filter( 'woocommerce_prepare_email_for_preview', 'wp_kama_woocommerce_prepare_email_for_preview_filter' );
/**
* Function for `woocommerce_prepare_email_for_preview` filter-hook.
*
* @param WC_Email $email The email object.
*
* @return WC_Email
*/
function wp_kama_woocommerce_prepare_email_for_preview_filter( $email ){
// filter...
return $email;
}
- $email(WC_Email)
- The email object.
Список изменений
| С версии 9.6.0 | Введена. |
Где вызывается хук
woocommerce_prepare_email_for_preview
woocommerce/src/Internal/Admin/EmailPreview/EmailPreview.php 238
$this->email = apply_filters( 'woocommerce_prepare_email_for_preview', $this->email );
Где используется хук в WooCommerce
woocommerce/src/Internal/StockNotifications/Emails/EmailManager.php 48
add_filter( 'woocommerce_prepare_email_for_preview', array( $this, 'prepare_email_for_preview' ) );