woocommerce_email_preheader(id)
Provides an opportunity to inspect and modify preheader for the email.
Использование
add_filter( 'woocommerce_email_preheader(id)', 'wp_kama_woocommerce_email_preheaderid_filter', 10, 3 ); /** * Function for `woocommerce_email_preheader(id)` filter-hook. * * @param string $preheader Preheader of the email. * @param object|bool $object The object (ie, product or order) this email relates to, if any. * @param WC_Email $email WC_Email instance managing the email. * * @return string */ function wp_kama_woocommerce_email_preheaderid_filter( $preheader, $object, $email ){ // filter... return $preheader; }
- $preheader(строка)
- Preheader of the email.
- $object(объект|true|false)
- The object (ie, product or order) this email relates to, if any.
- $email(WC_Email)
- WC_Email instance managing the email.
Список изменений
С версии 9.9.0 | Введена. |
Где вызывается хук
woocommerce_email_preheader(id)
woocommerce/includes/emails/class-wc-email.php 520
$preheader = apply_filters( 'woocommerce_email_preheader' . $this->id, $this->format_string( $this->get_option_or_transient( 'preheader', '' ) ), $this->object, $this );