Resolved
Resolved in: WPML 4.6.7
Overview of the issue
If you are using LiteSpeed Cache plugin, you may encounter an issue translating posts. Specifically, when users create and translate a new post, the translated post does not retain the category from the original post.
Workaround
Option 1
- Go to Litespeed cache > Cache > Purge > Auto Purge Rules For Publish/Update page.
- Disable the Term archive (include category, tag, and tax) option.
Or:
Option 2
Please, make sure of having a full backup of your site before proceeding.
- Open …/wp-content/plugins/litespeed-cache/src/purge.cls.php file
- Look for line 1172.
- Change:
1
$terms
= get_the_terms(
$post_id
,
$tax
);
- For
12345678910111213
// 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
);
}