WC_Email_Customer_Abandoned_Cart_Recovery::get_unsubscribe_url
Get the unsubscribe URL for the currently-bound order's recipient.
Returns an HMAC-signed URL routed through Endpoint::QUERY_VAR (?wc-email-unsubscribe=…) and handled by UnsubscribesEndpoint. Empty when no order is bound or the order has no billing email — both states mean there's no recipient to unsubscribe and the template should suppress the footer link.
Метод класса: WC_Email_Customer_Abandoned_Cart_Recovery{}
Хуков нет.
Возвращает
Строку.
Использование
$WC_Email_Customer_Abandoned_Cart_Recovery = new WC_Email_Customer_Abandoned_Cart_Recovery(); $WC_Email_Customer_Abandoned_Cart_Recovery->get_unsubscribe_url();
Список изменений
| С версии 11.0.0 | Введена. |
Код WC_Email_Customer_Abandoned_Cart_Recovery::get_unsubscribe_url() WC Email Customer Abandoned Cart Recovery::get unsubscribe url WC 11.0.1
public function get_unsubscribe_url() {
if ( ! $this->object instanceof WC_Order ) {
return '';
}
$email = $this->object->get_billing_email();
if ( '' === $email ) {
return '';
}
return UnsubscribesEndpoint::url_for( $this->object->get_id(), $email, $this->id );
}