We would like to create custom roles with Toolset and WPML languages to these roles. The aim is to ensure that users in the WP admin can only edit and create content with authorisations and the assigned languages.
We found this: https://wpml.org/documentation/translating-your-contents/how-to-use-access-plugin-to-create-editors-for-specific-language/#users-and-roles
However we do not have the options to set a language for a custom role & post type.
Example: Custom Role "Editors IT" should be able to translate EN content and they should not be allowed to edit the EN content until they have the permissions for the language EN.
Do we have to get stuck into the hooks at this point?
How should the the paramter language for the filter "toolset_access_api_get_post_permissions" work? Is this the setting under WMPL > Translations for the single user? Meta field wp_language_pairs?
Any ideas how to solve this Issue?
Hi,
Welcome to Toolset support. May I have more context about the situation?
Maybe if you could provide the login information by setting the next reply as private and provide some screenshots so I can check the UI and see what you want to achieve.
Thanks.
We would like to map authorisations for the languages at group level instead of at user level. Is it possible to map this out of the box with Toolset?
Instead of using custom hooks and filter we would like to add a language for each group.
Is this possible with Toolset and WPML?
Hi,
It is not possible to assign languages to groups created by Toolset as WPML does not have access to that group and in the translation management, you can only add translators per user and not group.
To achieve such a feature you need custom coding that is outside of our support scope. You are welcome to hire a developer to do so:
https://toolset.com/contractors/
The developer needs to use Use Toolset Access API and Use WPML Hooks.
The overall view will be as follows:
1. Restrict Editing Based on WPML Language
Using toolset_access_api_get_post_permissions to filter the editing permissions.
2. Prevent Users from Editing Other Languages
Using the wp_insert_post_data filter to block saving if a user tries to edit a language they don’t have access to.
3. Assign Users to Translation Languages
Programmatically assign language pairs for the users of the group in WPML using the wp_language_pairs field.
The points above is to just give a roadmap of what needs to be done. We will not be able to implement such a feature.
Thank you.