过滤器带有一个优先级参数,默认值为10,因此要覆盖函数,需要增加优先级:
add_filter( \'wcml_switch_currency_exception\', \'cart_switching_currency\', 99, 4 );
add\\u筛选器(字符串$标记,可调用$function\\u to\\u add,int$priority=10,int$accepted\\u args=1)
更多信息请访问add_filter
更新时间:
如果删除筛选器不起作用,可以尝试以下方法:
function remove_cart_switching_currency_filter(){
remove_filter(\'wcml_switch_currency_exception\', \'cart_switching_currency\', 10, 4);
}
add_action( \'after_setup_theme\', \'remove_cart_switching_currency_filter\' );
Important is that the priorities must match.
有关的更多信息
after_setup_theme