- This topic has 9 replies, 2 voices, and was last updated 6 years ago by
Tom.
-
AuthorPosts
-
July 21, 2016 at 12:03 pm #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 !
July 21, 2016 at 7:59 pm #211864Tom
Lead DeveloperLead DeveloperHi 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 π
July 22, 2016 at 1:25 pm #212040Rob
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 !
July 22, 2016 at 6:33 pm #212129Tom
Lead DeveloperLead DeveloperNo problem! Remind me when GP Premium 1.2.89 is released and I’ll write up the function for you π
May 21, 2017 at 7:42 am #321664Rob
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
May 21, 2017 at 10:29 am #321730Tom
Lead DeveloperLead DeveloperWho are you trying to hide or disable it for?
May 21, 2017 at 10:47 am #321739Rob
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
May 21, 2017 at 10:49 am #321744Tom
Lead DeveloperLead DeveloperTry 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/
May 21, 2017 at 4:58 pm #321861Rob
Thanks Tom , I’ll try this out
May 21, 2017 at 6:19 pm #321905Tom
Lead DeveloperLead DeveloperNo problem π
-
AuthorPosts
- You must be logged in to reply to this topic.