Home › Toolset Professional Support › [Resolved] Do I need to create 'permission per language' for each language and post type?
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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
This topic contains 9 replies, has 2 voices.
Last updated by johnM-37 8 months ago.
Assisted by: Minesh.
Hi,
We have 20 languages, and I want to use Toolset Access Control to create a Language Editor for each language.
I'm following this tutorial https://wpml.org/documentation/translating-your-contents/how-to-use-access-plugin-to-create-editors-for-specific-language/
It all works perfectly but we have 6 post types and I want to know do I have to create a 'permission per language' for each language and post type. For example:
- Spanish Posts
- Spanish Pages
- Spanish Events
- Spanish Scriptures
- Spanish Prayers
...
- German Posts
- German Pages
- German Events
- German Scriptures
- German Prayers
... etc.
It would mean that I need to create 6 permissions per language for 20 languages, a total of 120 WPML Groups! I have tried combining languages into a group, for example, "Spanish, German Posts" but this just gave languages the ability to edit each other's content.
Is there a way for me to combine posts into a post group called "All Posts"? That way I would just have to create one WPML group for each language.
Many thanks,
John
Hello. Thank you for contacting the Toolset support.
The permissions/capabilities are managed per post type I'm afraid there is no other option. This is how it works and you will have to follow the standard.
Hi Minesh,
OK, so I went ahead and created a WPML Group for each post type / language. When I go to create WPML Groups, one of my custom post types is not showing in the dropdown list. The only difference between it and the others is that it has a custom taxonomy. The custom post type (called events), is set to "Managed by Access" like all the other post types. Why would the "events" custom post type not be available?
John
Can you please share admin access details and allow me to review your setup.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I see you only installed the Toolset Access plugin.
Also - I was amazed when I see you have taxonomy and post type slug are same.
With WordPress - you should always use unique slug names for posts, post types, taxonomies, terms etc..etc..
I would like to know how the post type Event is registered as well as taxonomy Event?
Yes, I only installed the Toolset Access plugin because we only need access to those features. If you believe I should have installed extra plugins please let me know which ones and why.
Yes, the post type and taxonomy are different (event and events), but the events taxonomy has the 'event' slug so that we don' end out with the URL "/event/events/name-of-event/", instead we use "/event/name-of-event/". It has worked fine for us so far and it would take a lot of work to change it now. Do you believe this is why Toolset is not recognising the "event" post type?
Here's the code used to create this specific post type and taxonomy.
register_post_type('event', [
'description' => 'Retreats, Novenas and other specific events.',
'public' => true,
'hierarchical' => false,
'has_archive' => true,
'public' => true,
'publicly_queryable' => true,
'query_var' => true,
'show_ui' => true,
'show_in_rest' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'exclude_from_search' => false,
'can_export' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-megaphone',
'supports' => ['title', 'editor', 'thumbnail', 'author', 'revisions', 'comments'],
'rewrite' => ['slug' => 'event', 'with_front' => true],
'labels' => [
'name' => __('Events', 'sacred-space-plugin'),
'singular_name' => __('Events', 'sacred-space-plugin'),
'add_new_item' => __('Add new Event', 'sacred-space-plugin'),
'new_item' => __('New Event', 'sacred-space-plugin'),
'view_item' => __('View Event', 'sacred-space-plugin'),
'not_found' => __('No Events found', 'sacred-space-plugin'),
'not_found_in_trash' => __('No Events found in trash', 'sacred-space-plugin'),
'all_items' => __('All Events', 'sacred-space-plugin'),
'insert_into_item' => __('Insert into Events', 'sacred-space-plugin')
],
]);
register_taxonomy('events', ['event'], [
'label' => __('Event Series', 'txtdomain'),
'hierarchical' => true,
'show_admin_column' => true,
'show_in_rest' => true,
'labels' => [
'singular_name' => __('Event Series', 'txtdomain'),
'all_items' => __('All Event Series', 'txtdomain'),
'edit_item' => __('Edit Event Series', 'txtdomain'),
'view_item' => __('View Event Series', 'txtdomain'),
'update_item' => __('Update Event Series', 'txtdomain'),
'add_new_item' => __('Add New Event Series', 'txtdomain'),
'new_item_name' => __('New Event Series', 'txtdomain'),
'search_items' => __('Search Event Series', 'txtdomain'),
'popular_items' => __('Popular Event Series', 'txtdomain'),
'parent_item' => __('Parent Event Series', 'txtdomain'),
'separate_items_with_commas' => __('Separate Event Series with comma', 'txtdomain'),
'choose_from_most_used' => __('Choose from most used Event Series', 'txtdomain'),
'not_found' => __('No Event Series found', 'txtdomain'),
]
]);
register_taxonomy_for_object_type('series', 'events');
I must suggest still that you should use unique slugs for post type and taxonomies. As sooner or later it might cause the issue.
I would like to know the code you shared - where exactly to what file you added that code.
To debug this further - I will require duplicator copy of your site. Can you please send me duplicator copy of your site.
- https://toolset.com/faq/provide-supporters-copy-site/
I have set the next reply to private which means only you and I have access to it.
I cannot provide you with a full duplicate of the site but you can use the "Plugin File Editor" to view the plugins code. The "Sacred Space Manager" plugin is where we defined the custom post types. You can edit as you wish and I will refresh the site afterwards.
We also have another question. The emails that come from WPML normally only list links to translations in the translator's own language, but when we add that user to WPML groups, they get sent links to all languages that have text that needs translating (please see screenshots).
- Screenshot links to only the language that the user has been assigned within WPML.png (the way things should be)
- Screenshot WPML email with links to all languages.png (the way things are after setup of Toolset Access WPML Groups access)
Why does creating permission for languages not apply the same restriction to the emails coming from WPML?
As per our support policy - we entertain only one question per ticket. This will help other users searching on the forum as well as help us to write correct problem resolution summery.
For now - we will continue with the original question reported with this ticket.
I set the post type "Events" as "Translatable" from WPML Settings:
- hidden link
Then when I visit the WPML Groups tab and click on the button "Create permission for languages" I can see the "Event" post type in dropdown:
- hidden link
Thank you Minesh. I should have remember that step in my original setup of WPML. Thank you for finding the issue and letting me know how to resolve it.