问题概述
适用于 WooCommerce 的 [MC4WP] – Mailchimp for WordPress 集成不会在前端显示已翻译的结账复选框标签,尽管翻译在 WPML 的字符串翻译中正确显示。
临时解决方法
这个问题已修复。 更新到最新版本即可在您的站点上解决此问题,因此,只有当您暂时无法更新时,才需要此临时解决方法。
请确保在继续操作之前对您的站点进行完整备份。
- 打开 …/wp-content/plugins/mailchimp-for-wp/includes/integrations/class-integration.php文件。
- 找到第 168 行。
- 将:
public function get_label_text() { $integration = $this; $label = $this->options['label']; if (empty($label)) { $default_options = $this->get_default_options(); $label = $default_options['label']; } - 替换为:
public function get_label_text() { $integration = $this; $label = $this->options['label']; if (empty($label)) { $default_options = $this->get_default_options(); $label = __( $default_options['label'], 'mailchimp-for-wp' ); } else { do_action( 'wpml_register_single_string', 'mailchimp-for-wp', 'Checkout Label', $label ); $label = apply_filters( 'wpml_translate_single_string', $label , 'mailchimp-for-wp', 'Checkout Label' ); }