- This topic has 13 replies, 5 voices, and was last updated 3 years, 9 months ago by
Tom.
-
AuthorPosts
-
January 20, 2022 at 3:17 am #2086974
Mihail
Hi all!
Can you tell me how to hide the settings of premium, and everything related to this plugin in the admin area of the site?
The thing is, I don’t want the person I’m making the site to have access to all of the GP Premium features, as well as my license key.
Thx ๐January 20, 2022 at 8:34 pm #2088094Elvin
StaffCustomer SupportHi Mihail,
You’ll need this filter.
https://docs.generatepress.com/article/generate_dashboard_page_capability/Example usage:
https://docs.generatepress.com/article/remove-the-gp-dashboard-for-non-super-admins/January 23, 2022 at 4:27 am #2090484Mihail
Hi. I think you don’t quite know what I mean.
I want to hide the plugin NOT for any groups of users, but from all. Including myself.
Meaning. I am making a site for a client. And I don’t want him to know that I used the GP Premium plugin.
After the work is done from my side, I want to completely hide from everyone the presence of the plugin in the admin panel.Once upon a time I found something like this. Some code was written in functions.php, but I can not find it ๐
January 23, 2022 at 1:12 pm #2091063Leo
StaffCustomer SupportMaybe an article like this would help?
https://webcusp.com/how-to-hide-specific-plugin-from-installed-plugin-list/If not then my recommendation would be to check with WP’s support team and see if they have a function to hide “any” plugins from the plugins page.
This wouldn’t be a plugin-specific issue.
January 23, 2022 at 3:05 pm #2091135Mihail
I want to hide GeneratePress premium options in the admin panel. Specifically, right here:
At a minimum, I need to hide the license key field.
Ideally, I’d also like to hide the module fields.
January 23, 2022 at 10:57 pm #2091321Elvin
StaffCustomer SupportI get what you mean but I didn’t get the full details of the extent of how or what should be disabled. I assumed you only want to disable it for normal users EXCEPT for Super admin.
You’re aiming to completely remove the access of GP Premium for ALL ROLES once you’re done with the development. But removing Admin accounts’ privileges means locking it and throwing out the key for good.
But to answer the question:
You can get any role editor plugins and remove the
edit_theme_options
privileges for the Administrator role as well.But be warned, this means no one will be able to make any changes anymore as even an Admin account effectively can’t do anything about it as well. (meaning if the client hires a new developer to modify things, it will be an issue)
January 24, 2022 at 4:36 am #2091541Mihail
If I’m not mistaken, this code worked on older versions:
https://generatepress.com/forums/topic/limit-access-to-theme-options-menu/
But now when you add this code – nothing happens.It seems to me that this is due to the fact that the premium options now have a radically different look.
January 24, 2022 at 5:32 pm #2092402Tom
Lead DeveloperLead DeveloperHi there,
Yes, that code has changed with the Dashboard re-design.
Try this:
add_action( 'after_setup_theme', function() { remove_action( 'admin_menu', array( 'GeneratePress_Dashboard', 'add_menu_item' ) ); } );
Let me know ๐
January 25, 2022 at 5:06 am #2092850Mihail
Hi, Tom!
Do I understand correctly that this code:add_action( 'after_setup_theme', function() { remove_action( 'admin_menu', array( 'GeneratePress_Dashboard', 'add_menu_item' ) ); } );
should be inserted at the end of functions.php? If so, nothing happened ๐
was (without code):
became (with code):
I don’t see any difference. Unfortunately…
January 25, 2022 at 5:53 am #2092896David
StaffCustomer SupportTry this instead:
add_action( 'wp', function() { remove_action( 'admin_menu', array( 'GeneratePress_Dashboard', 'add_menu_item' ) ); } );
January 25, 2022 at 6:21 am #2092932Mihail
Nothing…
I changed the site language to English and once again add login, pass.
I did this so you can see for yourself and test. Try it.
January 25, 2022 at 2:18 pm #2093656Tom
Lead DeveloperLead DeveloperLet’s give this a shot, instead:
add_action( 'admin_init', function() { remove_submenu_page( 'themes.php', 'generate-options' ); } );
Let us know ๐
January 26, 2022 at 4:30 am #2094132Mihail
Yes, yes, yes.
add_action( 'admin_init', function() { remove_submenu_page( 'themes.php', 'generate-options' ); } );
It works! And that’s what it takes ๐
Thank you.Tom, David – you are the coolest! ๐ค
January 26, 2022 at 8:48 pm #2095234Tom
Lead DeveloperLead DeveloperGlad we could help! ๐
-
AuthorPosts
- You must be logged in to reply to this topic.