Jump to content

How to hide RSS Feed from Announcements in Client Area?


rottenteeth

Recommended Posts

Hi, actually I made this hook, but the RSS Feed doesn't not dissapper.

Could you give me some advice what I'm doing wrong?

I don't know which hook is correct, but all of this do not remove View RSS Feed from Announcements.

<?php

use WHMCS\View\Menu\Item as MenuItem;

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

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $secondarNavbar)
{
   if (!is_null($secondarNavbar->getChild('Announcements'))) {
       $secondarNavbar->getChild('Announcements')
            ->removeChild('View RSS Feed');       
   }
}); 

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
   if (!is_null($primarySidebar->getChild('Announcements'))) {
       $primarySidebar->getChild('Announcements')
            ->removeChild('View RSS Feed');       
   }
});

add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar)
{
   if (!is_null($secondarySidebar->getChild('Announcements'))) {
       $secondarySidebar->getChild('Announcements')
            ->removeChild('View RSS Feed');       
   }
}); 

 

Link to comment
Share on other sites

21 hours ago, Damian Olko said:

I don't know which hook is correct, but all of this do not remove View RSS Feed from Announcements.

the third one is the closest - it's a primary sidebar, but it's called 'RSS Feed' rather than 'View RSS Feed'.

another way, assuming that you're using Six or 21 (or a child of either) would be to use CSS in a custom.css file...

#Primary_Sidebar-Announcements_Months-RSS_Feed {display: none !important;}
Link to comment
Share on other sites

  • 2 weeks later...

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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