Background of the issue:
I am trying to allow users to edit the translations of other users. I want all my users in a role that can a specific post type to also edit the translations.
hidden link
Symptoms:
Only users that are editors can edit other translations. When giving them editor caps, these users also get posts/page capabilities which is not desired.
Questions:
How can I allow users to edit translations of other users without giving them full editor capabilities?
Is there a way to define custom capabilities for user roles and post types specifically for translation editing?
You will have to install a Members plugin that allows for adding new Roles and adjusting existing Roles. Be careful though as the changes made with those type of plugins are mostly definitive.
Also, this has nothing to do with WPML, and everything with WordPress Core.
I followed the below steps to reproduce this issue:
1. Created a fresh WP site(auto login URL): hidden link
2. Added one user with Editor role, and another user with Subscriber role.
3. Added both users as translators from WPML >> Translation Management > Translators tab.
4. Edited the translation with the editor role from Posts >> All Posts by clicking on the Plus(+) icon.
5. Logged in with Subscriber role but the Posts page was not available for subscriber, so I added below code in functions.php file of the active theme to allow subscriber user role to access the Posts page:
function allow_subscriber_post_editing() {
$role = get_role('subscriber');
if ($role) {
$role->add_cap('edit_posts');
$role->add_cap('edit_published_posts');
$role->add_cap('publish_posts');
$role->add_cap('delete_posts');
}
}
add_action('init', 'allow_subscriber_post_editing');
Then tried to edit the translation from Posts >> All Posts by clicking on the Plus(+) icon and it works without any issues.
Could you please check and let me know if I missed something?
Thank you for your cooperation and patience
The topic ‘[Closed] Allow editing translations of other users’ is closed to new replies.