我正在尝试使用以下代码更改基于站点语言的管理员电子邮件:
if ( !function_exists('my_email_heading_customisation_function_ent') ) {
function my_email_heading_customisation_function_ent( $recipient, $order )
{
global $woocommerce;
$page = $_GET['page'] = isset( $_GET['page'] ) ? $_GET['page'] : '';
if ( 'wc-settings' === $page ) {
return $recipient;
}
// just in case
if ( ! $order instanceof WC_Order ) {
return $recipient;
}
$recipient = "[email protected]";
return $recipient;
}
add_filter('woocommerce_email_recipient_new_order', 'my_email_heading_customisation_function_ent', 10, 2);
}
但它不起作用。
任何想法如何解决这个问题?
有很多线索,有些真的太老了。我检查了文档,没有提到任何与此钩子相关的更改。我一直把头发拉过来。
好的,谢谢你的帮助。原来,过滤器正在工作,问题是由HYYAN Woocommerce Polylang integration引起的。我将用插件作者解决它...
Josif