WPML
ステータス
開発者により解決済み
関連するプラグイン/テーマ
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'));

すべての既知の問題 →