Change WordPress user roles and capabilities › Forums › How to or FAQ › Including Tablepress in a Role
- This topic has 6 replies, 2 voices, and was last updated 3 years, 12 months ago by Vladimir.
-
AuthorPosts
-
18/10/2019 at 12:03 #6050ederingParticipant
I can’t get Tablepress to show for a Role (my SDoL Admin role). I have all 5 capabilities for Tablepress Table selected. What’s weird is when I go to the Admin Menu, Tablepress does not even show as something I can show/block. How do I let the Role have access to all of Tablepress?
19/10/2019 at 14:34 #6053VladimirKeymaster“Admin menu” shows menu items available to the selected role according to permissions granted to this role. When you need to look what permission/capability is required for some menu item, open “Admin menu” for “administrator” role, which has all existing capability by default.
Table press is protected by these user capabilities:
19/10/2019 at 15:10 #6055ederingParticipantthanks!
23/10/2019 at 17:28 #6059ederingParticipantVladamir, I have something similar going on for the GTranslate plugin – https://wordpress.org/support/plugin/gtranslate/. I don’t see it in Admin Menu, and when I go to Administrator and look at Admin Menu, it shows “administrator.” https://www.screencast.com/t/s87umrEtcrHG How do I add access to that for a Role created in URE (one that is not the full-rights admin)?
24/10/2019 at 04:08 #6060VladimirKeymasterUnfortunately, GTranslate developer uses ‘administrator’ role to protect its menu item under ‘Settings’ menu. Look at the gtranslate.php file, line #231:
add_options_page(__('GTranslate Options', 'gtranslate'), 'GTranslate', 'administrator', 'gtranslate_options', array('GTranslate', 'options'));
The only way to make possible to add access to this menu item for other roles except ‘administrator’ is to replace ‘administrator’ at this line with ‘manage_options’, or any other user capability suitable for your purpose.
28/12/2020 at 13:36 #7226ederingParticipantHi Vladimir. Based o your response to my reply 23/10/2019, is there a way to do this in our functions file so we don’t edit their plugin? And, if so, can we have it set to the current setting of ‘administrator’ AND a second Role (‘sdol-admin’)? I don’t want to set it to Manage Options because we have several Roles that have access to that, and I would need to Block that in Admin Menu for them all.
02/01/2021 at 05:09 #7233VladimirKeymasterHi,
It’s possible. Code below redefines gTranslate menu with ‘manage_options’ capability:
add_action('plugins_loaded', 'redefine_gtranslate_menu'); function redefine_gtranslate_menu() { remove_action('admin_menu', array('GTranslate', 'admin_menu'), 10 ); add_action('admin_menu', 'replace_gtranslate_menu' ); } function replace_gtranslate_menu() { add_options_page(__('GTranslate Options', 'gtranslate'), 'GTranslate', 'manage_options', 'gtranslate_options', array('GTranslate', 'options') ); }
-
AuthorPosts
- You must be logged in to reply to this topic.