- ステータス
- 未解決
- 関連するプラグイン/テーマ
- Bricks
- トピックタグ
- Compatibility
問題の概要
WPML Media Translationプラグインが有効になっている場合、BricksテンプレートでWPMLの複製機能を使用すると、デフォルト言語での変更が他の言語に反映されない問題が発生します。
回避策
続行する前に、必ずサイトの完全なバックアップを取得してください。
パートI
- …/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-custom-field-images-translation.phpファイルを開きます。
- 56行目を探します。
- 以下の直後に:
$setting = $settings_factory->post_meta_setting( $meta_key );
- 次を追加します:
// Workaround part 1 $bricks_meta_keys = array( '_bricks_template_type', '_bricks_page_content_2', '_bricks_editor_mode', '_bricks_template_settings', ); if ( strpos( $meta_key, 'bricks' ) !== false ) { return; }
パートII
- …/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-set-posts-media-flag.phpファイルを開きます。
- 128行目を探します。
- 以下の直後に:
$post_with_media_files = $this->post_with_media_files_factory->create( $post_id );
- 以下の部分をコメントアウトします:
// Workaround part 2 /*if ( $post_with_media_files->get_media_ids() ) { // it seems that this line is causing this issue update_post_meta( $post_id, self::HAS_MEDIA_POST_FLAG, 1 ); } else { delete_post_meta( $post_id, self::HAS_MEDIA_POST_FLAG ); }*/