woocommerce_email_recipient_(id)
Filter the recipient for the email.
Использование
add_filter( 'woocommerce_email_recipient_(id)', 'wp_kama_woocommerce_email_recipient_id_filter', 10, 3 );
/**
* Function for `woocommerce_email_recipient_(id)` filter-hook.
*
* @param string $recipient Recipient.
* @param object $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_recipient_id_filter( $recipient, $object, $email ){
// filter...
return $recipient;
}
- $recipient(строка)
- Recipient.
- $object(объект)
- The object (ie, product or order) this email relates to, if any.
- $email(WC_Email)
- WC_Email instance managing the email.
Список изменений
| С версии 2.0.0 | Введена. |
| С версии 3.7.0 | Added $email parameter. |
Где вызывается хук
woocommerce_email_recipient_(id)
woocommerce/includes/emails/class-wc-email.php 617
$recipient = apply_filters( 'woocommerce_email_recipient_' . $this->id, $this->recipient, $this->object, $this );