Open
Reported for: WPML Multilingual CMS 4.6.6
Overview of the issue
With WPML, you can add individual translators as users to your site, assign language pairs, then assign translation jobs to them in Translation Management. However, translators with the WordPress Editor role are able to duplicate posts into languages that are not within their assigned language pairs.
Workaround
Please, make sure of having a full backup of your site before proceeding.
- Open …/wp-content/plugins/sitepress-multilingual-cms/menu/post-menus/post-edit-screen/wpml-meta-boxes-post-edit-html.class.php file.
- Look for line 524.
- Replace:
if ( $translation_status && $translation_status < ICL_TM_COMPLETE ) {
- With:
$lang_from = trim(implode(array_keys($translations)));
$lang_to = $lang["code"];
$userlanguages = get_user_meta(get_current_user_id(),$this->sitepress->wpdb()->prefix . 'language_pairs',true );
foreach ($userlanguages as $from => $to ) {
$set_to_disable = true;
if ($lang_from == $from){
if ($lang_to == trim(implode(array_keys($to)))){
$set_to_disable = false;
}
}
}
if ( $translation_status && $translation_status < ICL_TM_COMPLETE || $set_to_disable ) {