Black Friday Sale! Get up to $30 off GP Premium! Learn more ➝

[Resolved] Multi Site Activation

Home Forums Support [Resolved] Multi Site Activation

Home Forums Support Multi Site Activation

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #211769
    Rob

    Hi,

    New to GeneratePress and what an amazing Theme and set of add-ons, I wish I had found this sooner as its one of the most polished themes I’ve ever used.

    My query is regarding the Licence Activation box and the “Hooks” plugin.

    I now run all my clients through Multi Site, each client is the Admin of their site and I am the Network Super Admin.

    When a client logs in they will see the Licence Activation box and also Support links for generate press which will cause confusion as they may think they have to go here for Theme Support or start contacting me for a licence key. This potential for confusion could be eliminated if there was an ability to hide these particular blocks.

    Would it be possible to add in a function that checks if the user role has “manage_network” permissions, and if they don’t to not display these 2 options ?

    Could the same also be applied to the Hooks plugin ? In an MU environment this creates a security problem.

    Maybe you could release it as a white label plugin for developers ? I’d gladly pay for it as an option

    Thanks !

    #211864
    Tom
    Lead Developer
    Lead Developer

    Hi Rob,

    You can use a function like this to hide those sections:

    add_action( 'admin_head','generate_remove_gp_metabox' );
    function generate_remove_gp_metabox()
    {
    	?>
    	<style>
    		.generate-metabox#gen-1,
    		.generate-metabox#generate-license-keys,
    		.generate-metabox#gen-delete {
    			display: none;
    		}
    	</style>
    	<?php
    }

    As for hooks, it’s not currently possible to change the capability. I’ve added a filter for the next version so it will be possible.

    Let me know if you need more info πŸ™‚

    #212040
    Rob

    Hey Tom,

    That function worked perfect thanks.

    Glad to hear there is a filter coming for the hooks plugin, for the moment I just commented out the lines for it the PHP file so I’m looking forward to your solution for the long term.

    Thanks for the help !

    #212129
    Tom
    Lead Developer
    Lead Developer

    No problem! Remind me when GP Premium 1.2.89 is released and I’ll write up the function for you πŸ™‚

    #321664
    Rob

    Slightly dragging up an old post but I’m wondering if the ability to hide or disable the Hooks add-on is now possible in Multi-Site ?

    Thanks

    #321730
    Tom
    Lead Developer
    Lead Developer

    Who are you trying to hide or disable it for?

    #321739
    Rob

    All my clients. So I’m the Network Admin but I don’t want any other users to be able to see or activate the Hooks addon.

    Currently I edit the file manually every time there’s an update to remove that line but I’ve forgotten once or twice

    #321744
    Tom
    Lead Developer
    Lead Developer

    Try this:

    add_filter( 'generate_hooks_capability','tu_network_admin_hooks' );
    function tu_network_admin_hooks() {
        return 'manage_network';
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    #321861
    Rob

    Thanks Tom , I’ll try this out

    #321905
    Tom
    Lead Developer
    Lead Developer
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.