Jump to content

Removing Action Sidebar Menu from My Products and Services page.


Recommended Posts

I am trying to remove the sidebar menu "Actions" from the My Products and Services page.  I have created the following hook:

```
<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
   if (!is_null($primarySidebar->getChild('My Services Actions'))) {
            $primarySidebar->removeChild('My Services Actions');
   }    

});
```
But it is not removing the sidebar from the page /clientarea.php?action=services
What am I doing wrong?

Thanks,

Steve

Link to comment
Share on other sites

Hi Steve,

On 21/06/2020 at 04:44, stevelack said:

What am I doing wrong?

the only issue with the code is that the Services Actions sidebar is a secondary sidebar and not a primary one... therefore, all you should need to do is change all references to "Primary" and "primary" to "Secondary" and "secondary". 🙂

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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