- 状态
- 已解决
- 解决于
- WooCommerce Multilingual & Multicurrency 5.5.0
- 相关插件/主题
- WooCommerce
- 主题标签
- Compatibility, WCML
问题概述
在某些情况下,WooCommerce 产品评论旁边显示的国旗可能会错误地反映当前的网站语言,而不是最初提交评论时使用的语言。
临时解决方法
在继续操作之前,请确保对您的站点进行完整的站点备份。
- 将以下代码添加到您主题的 functions.php 文件中:
add_filter ('the_comments', 'remove_hooks10903'); function remove_hooks10903($var) { global $wp_filter; foreach ( $wp_filter["the_comments"]->callbacks[10] as $key => $value ) { if ( str_contains( $key, 'translate_product_ids' ) ) { remove_filter( 'the_comments', $key ); } } return $var; }