WPML
状态
已解决
解决于
WPML 4.6.7
相关插件/主题
LiteSpeed Cache
主题标签
Compatibility

问题概述

如果您正在使用 LiteSpeed Cache 插件,在翻译文章时可能会遇到问题。具体来说,当用户创建并翻译新建文章时,翻译后的文章不会保留原文章的分类。

临时解决方法

选项 1


  • 前往 Litespeed cache > Cache > Purge > Auto Purge Rules For Publish/Update 页面。

  • 禁用 Term archive (include category, tag, and tax) 选项。

或者:

选项 2


在继续操作之前,请确保对您的站点进行完整备份

  • 打开 …/wp-content/plugins/litespeed-cache/src/purge.cls.php 文件

  • 找到第 1172 行。

  • 将:
    				$terms = get_the_terms($post_id, $tax);


  • 更改为:
    				// WPML Workaround for compsupp-6805
    				$terms = '';
    
    				if( class_exists('SitePress') ){
    					$default_language = apply_filters('wpml_default_language', NULL );
    					$current_language = apply_filters('wpml_current_language', NULL );
    					
    					if ( $default_language === $current_language ) {
    						$terms = get_the_terms($post_id, $tax);	
    					} 
    				} else {
    					$terms = get_the_terms($post_id, $tax);	
    				}

所有已知问题 →