Site logo

[Resolved] How to hide GP Premium functionality in the admin panel?

Home Forums Support [Resolved] How to hide GP Premium functionality in the admin panel?

Home Forums Support How to hide GP Premium functionality in the admin panel?

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #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 ๐Ÿ™‚

    #2088094
    Elvin
    Staff
    Customer Support
    #2090484
    Mihail

    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 ๐Ÿ™

    #2091063
    Leo
    Staff
    Customer Support

    Maybe 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.

    #2091135
    Mihail

    I want to hide GeneratePress premium options in the admin panel. Specifically, right here:
    https://c.radikal.ru/c17/2201/ec/84e792b885f5.png

    At a minimum, I need to hide the license key field.

    Ideally, I’d also like to hide the module fields.

    #2091321
    Elvin
    Staff
    Customer Support

    I 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)

    #2091541
    Mihail

    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.

    #2092402
    Tom
    Lead Developer
    Lead Developer

    Hi 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 ๐Ÿ™‚

    #2092850
    Mihail

    Hi, Tom!
    https://c.radikal.ru/c15/2201/08/a6f0779d0f41.png
    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):
    https://a.radikal.ru/a34/2201/c1/19f3d642c017.png

    became (with code):
    https://a.radikal.ru/a13/2201/a1/4c3635a975f3.png

    I don’t see any difference. Unfortunately…

    #2092896
    David
    Staff
    Customer Support

    Try this instead:

    add_action( 'wp', function() {
        remove_action( 'admin_menu', array( 'GeneratePress_Dashboard', 'add_menu_item' ) );
    } );
    #2092932
    Mihail

    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.

    #2093656
    Tom
    Lead Developer
    Lead Developer

    Let’s give this a shot, instead:

    add_action( 'admin_init', function() {
        remove_submenu_page( 'themes.php', 'generate-options' );
    } );

    Let us know ๐Ÿ™‚

    #2094132
    Mihail

    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! ๐Ÿค˜

    #2095234
    Tom
    Lead Developer
    Lead Developer

    Glad we could help! ๐Ÿ™‚

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.