Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebars documentation refers to non existent example #132

Open
eugenefvdm opened this issue Apr 10, 2019 · 0 comments
Open

Sidebars documentation refers to non existent example #132

eugenefvdm opened this issue Apr 10, 2019 · 0 comments

Comments

@eugenefvdm
Copy link

eugenefvdm commented Apr 10, 2019

The URL https://developers.whmcs.com/themes/sidebars/ contains this text below and example:

"Notice how in the above we first retrieve the Support menu item, followed by the Announcements menu item which is a child within that. The same logic should be applied to all dropdown menu items."

The above text refers to something that does not exist on that page. The example right above it instead refers to "My Account" and "Billing Information".

Here is a working example which refers to the correct names:

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar)
{
   if (!is_null($secondarySidebar->getChild('Support'))) {
               $secondarySidebar->getChild('Support')
                               ->removeChild('Announcements')
                               ->removeChild('Knowledgebase')
                               ->removeChild('Downloads');
   }
}); 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant