2.8.3 still deprecated notice when translating WooCommerce emails
-
Hi, thanks for trying to fix the deprecation notice on emails.
* Fixed deprecated notice when translating WooCommerce emails
I tested the last version 2.8.3 where your change log states this should be resolved but still it isn’t.
I can see you tried to resolve it by adding checks (line 147 to 151 of class-woocommerce-emails):if ( $recipients === null || $recipients === '' ) {
$recipients = [];
} elseif ( !is_array($recipients) ) {
$recipients = explode( ',', $recipients );
}but just before those checks you are calling:
$recipients = $wc_email->get_recipient();
To get the recipients BUT wc_email->get_recipient() internally uses this code:
/**
* Get valid recipients.
*
* @return string
*/
public function get_recipient() {
$recipient = apply_filters( 'woocommerce_email_recipient_' . $this->id, $this->recipient, $this->object, $this );
$recipients = array_map( 'trim', explode( ',', $recipient ) );
$recipients = array_filter( $recipients, 'is_email' );
return implode( ', ', $recipients );
}Which basically means your fix solves nothing cause the first explode on null is already called inside the get_recipient() function of woocommerce. the only way around this is to write a filter for each email id and return “” instead of null for the recipient IF you need to hook trp_woo_setup_locale before the wc_email recipient is set up.
Can you have another look at that?
Cheers,
Paul
- You must be logged in to reply to this topic.