Remove or hide the "All" tab, in all modules

Hello,
I'm the administrator of a site running Elgg 5.1.12, and I've been asked to remove or hide the "All" tab in all content modules (pages, blog, files, etc.) so that only the "Mine" and "Friends" tabs are displayed.

Is it possible to do this in one go without having to modify all the modules individually?

Also, after removing the "All" tab, the tab that should be selected by default should be "Mine."

How can I do this in one go, without having to modify all the modules?

Thank you very much!

Best regards

  • You need to unregister 'register', 'menu:filter:filter' event and register a new event in your custom plugin:

    'menu:filter:filter' => [
        'Elgg\Menus\Filter::registerFilterTabs' => ['unregister' => true],
        'MyPlugin\Menus\Filter::registerFilterTabs' => [],
    ],
    Now just edit MyPlugin\Menus\Filter.php file.
     
    In this example we have overridden this class.
  • Thank you very much for your response.
    I was hoping there was a single file ("filter.php", for example) that I could easily copy and modify.

    I see the solution isn't as easy as I thought.

    Thank you very much, again.

    Best regards.