Skip Navigation

[Resolved] Add WPML languages at toolset group level to manage admin content access

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 3 replies, has 1 voice.

Last updated by Christopher Amirian 6 months, 2 weeks ago.

Assisted by: Christopher Amirian.

Author
Posts
#2793615

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?

#2793824

Christopher Amirian
Supporter

Languages: English (English )

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.

#2794381
Bildschirmfoto 2025-01-28 um 12.31.04.png
Bildschirmfoto 2025-01-28 um 12.27.22.png
Bildschirmfoto 2025-01-28 um 12.26.26.png
Bildschirmfoto 2025-01-28 um 12.25.48.png

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?

#2794532

Christopher Amirian
Supporter

Languages: English (English )

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.