Jump to content
arsalahmed786

How to remove knowledgebase tab in WHMCS

Recommended Posts

How to permanently knowledgebase tab ?

Yeah i saw old thread but i think these are too old

@Brian says: remove the following commend but where is it? on which file?

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
   if (!is_null($primaryNavbar->getChild('Knowledgebase'))) {
       $primaryNavbar->removeChild('Knowledgebase');
   }

   if (!is_null($primaryNavbar->getChild('Support'))) {
       $primaryNavbar->getChild('Support')
                       ->removeChild('Knowledgebase');
   }   
});

Please tell me where i can find above script so i can remove it.

Share this post


Link to post
Share on other sites

Nevermind i found how to use hook method.

but i want to remove Network status and knowledgebase both i can't remove 2 menu.

Share this post


Link to post
Share on other sites
1 hour ago, arsalahmed786 said:

Please tell me where i can find above script so i can remove it.

you don't REMOVE it, you ADD it... so create a new .php file in /includes.hooks, give it a filename (e.g kbremove.php) and paste the above code into it - and that should remove the two knowledgebase links.

the other way would be to add some css in a custom.css file...

#Primary_Navbar-Knowledgebase,
#Primary_Navbar-Support-Knowledgebase {display: none;}

but you only need to choose one method - hook or css - there is no need to use both of them.

Share this post


Link to post
Share on other sites
Just now, arsalahmed786 said:

but i want to remove Network status and knowledgebase both i can't remove 2 menu.

either method will work with other menu items - in the case of hooks, you just need to find it's "menuitemname" value... with regards to css, you just need it's ID value.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated