I'm aware of the search/header, but how do I disable any search boxes on the page? It should only be visible to Admin.
<?php
elgg_register_event_handler('init', 'system', 'minimal_hide_search_init');
function minimal_hide_search_init() {
if (!elgg_is_admin_logged_in()) {
elgg_unextend_view('page/elements/header', 'search/header');
}
}
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- jasoos@jasoos
jasoos - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
You must log in to post replies.Which your Elgg version?
Elgg 2.3
The code you mentioned should work.
I assume your custom plugin is not located at the bottom on the Plugins page.
Or you didn't clean the caches.
You can also try overriding this view instead:
Copy from \mod\search\views\default\search\header.php to \mod\my_plugin\views\default\search\header.php
Edit this file:
Flush the caches is required.
You can use this skeleton plugin for your customizations.