- 状态
- 已由作者解决
- 相关插件/主题
- BeTheme
- 主题标签
- Compatibility
问题概述
如果您正在使用 BeTheme 主题 及其全局部分,您可能会发现,尽管已有可用的翻译,这些部分在次要语言中并未显示其翻译版本。
临时解决方法
在继续操作之前,请确保对您的站点进行完整站点备份。
- 打开 …/wp-content/themes/betheme/functions/builder/class-mfn-builder-front.php 文件。
- 替换此代码:
public function show_sections($mfn_items, $vbtoolsoff = false){ if( !is_array($mfn_items) ) return; foreach ($mfn_items as $s => $section) { $section_class = []; - 替换为:
public function show_sections($mfn_items, $vbtoolsoff = false){ if( !is_array($mfn_items) ) return; foreach ($mfn_items as $s => $section) { // WPML workaround for compsupp-7262 if( class_exists('Sitepress') && ! empty($section['mfn_global_section_id'] ) ) { $section['mfn_global_section_id'] = apply_filters( 'wpml_object_id', $section['mfn_global_section_id'], get_post_type($section['mfn_global_section_id']) , TRUE ); } $section_class = []; - 其次,打开 …/wp-content/themes/betheme/functions/post-types/class-mfn-post-type-template.php 文件。
- 找到第 21 行。
- 替换:
public function __construct(){ if( !apply_filters('bebuilder_access', false) ){ return false; } if( !current_user_can('editor') && !current_user_can('administrator') ){ return false; } parent::__construct(); // fires after WordPress has finished loading but before any headers are sent add_action('init', array($this, 'register')); - 替换为:
public function __construct(){ // WPML Workaround for compsupp-7262 (Part 2) if ( ! class_exists('Sitepress') ) { if( !apply_filters('bebuilder_access', false) ){ return false; } if( !current_user_can('editor') && !current_user_can('administrator') ){ return false; } } parent::__construct(); // fires after WordPress has finished loading but before any headers are sent add_action('init', array($this, 'register'));