英文:
Is there a way to remove woocommerce_email_header action hook from emails without changing the plugin file?
问题
Here is the translated text:
"有没有人知道如何在不编辑插件文件的情况下移除这个动作 email_header
,该动作在插件文件中被调用(插件 -> WooCommerce -> 包括 -> class-wc-emails.php)。
我可以使用以下代码来移除该类:
remove_action('woocommerce_email_header', array($this, 'email_header'));
但只能在插件文件中使用。另外,我也尝试过:
remove_action('woocommerce_email_header', array('WC_Emails', 'email_header'));
图片链接"
请注意,代码部分不会进行翻译。如果还有其他需要翻译的内容,请继续提供。
英文:
Does anyone know how to remove this action email_header without editing this plugin file which the action is called in (plugins->woocommerce->includes->class-wc-emails.php).
I can remove the class with:
remove_action( 'woocommerce_email_header', array( $this, 'email_header' ) );
But only in the plugin file. Also I've tried:
remove_action( 'woocommerce_email_header', array( 'WC_Emails', 'email_header' ) );
答案1
得分: 1
以下是移除页眉的代码。如果有人需要,我将它保留在这里。
add_action('woocommerce_email', 'remove_wc_header');
function remove_wc_header($email_class) {
remove_action( 'woocommerce_email_header', array( $email_class, 'email_header' ), 10, 4 );
}
英文:
add_action('woocommerce_email', 'remove_wc_header');
function remove_wc_header($email_class) {
remove_action( 'woocommerce_email_header', array( $email_class, 'email_header' ), 10, 4 );
}
Here is the code to remove the header. I'll leave it here if anyone needs it
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论