This thread is resolved. Here is a description of the problem and solution.
Problem:
We are trying to set up a user role for translators on our site that gives them the permissions to edit and translate the content, but not to access plugins and theme options.
Solution:
Just add this code to the functions.php file:
add_filter('wpml_user_can_translate', function ($user_can_translate, $user){
if (in_array('editor', (array) $user->roles, true) && current_user_can('translate')) {
return true;
}
return $user_can_translate;
}, 10, 2);
67% of people find this useful.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Thank you for taking care of the site migration. I had another look at the settings thinking that I might be able to find a change to make things work, but I had no luck with that.
In this case, I asked my colleague to have another look and see what am I missing. I'll keep you posted on this one.
My colleague checked the migrated website but couldn't find any change to make things work. In this case, I had to escalate this to the 2nd tier to have a closer look at the issue. I'll keep you posted about the progress we're making on this one (this ticket is linked to the internal thread).
Can you try again to edit the translations using the editor account, please?
I just added this code to the functions.php file:
add_filter('wpml_user_can_translate', function ($user_can_translate, $user){
if (in_array('editor', (array) $user->roles, true) && current_user_can('translate')) {
return true;
}
return $user_can_translate;
}, 10, 2);
which enables this option. By default, the WPML behavior is to have only the admin or the original translator be able to edit the translations. However, this additional code will let the editor edit the translations as well.