Chuyển đến nội dung Chuyển đến thanh bên

Open

Topic Tags: Compatibility

Overview of the issue

When using the WPML’s duplication feature with Bricks templates, you will encounter that changes in default language are not being reflected in other languages when the WPML Media Translation plugin is active.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

Part I

  • Open …/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-custom-field-images-translation.php file.
  • Look for line 56.
  • Just after:
    		$setting          = $settings_factory->post_meta_setting( $meta_key );
    
  • Add:
    	// 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;
    	}
    

Part II

  • Open …/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-set-posts-media-flag.php file.
  • Look for line 128.
  • Just after:
    		$post_with_media_files = $this->post_with_media_files_factory->create( $post_id );
    
  • Comment the following part:
    		// 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 );
    		}*/
    

Để lại trả lời

Vui lòng giữ đúng chủ đề và tôn trọng người khác. Nếu bạn cần trợ giúp với các vấn đề không liên quan đến bài đăng này, hãy sử dụng Diễn đàn Hỗ trợ của chúng tôi để bắt đầu trò chuyện hoặc gửi vé hỗ trợ.

Bạn có thể sử dụng các thẻ này:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>