remove_action( ‘bp_get_displayed_user_nav’ );
Should be that to remove an action.
https://codex.buddypress.org/how-to-guides/modifying-the-buddypress-admin-bar/
Hey @modemlooper !
Thanks for your reply, but it doesn´t work… To remove the action bp_get_displayed_user_nav(), I need the hook to which the function to be removed is hooked.
https://codex.wordpress.org/Function_Reference/remove_action
I think bp_get_displayed_user_nav()… isn´t hooked anywhere!
Edit: Need a function like replace_action( $function_to_replace, $function_to_add, $priority, $accepted_args )
! Like str_replace in php, or something!^^
Why not just remove the code directly from the template file?
Yes, I could do this, but then I must update my code after every plugin update (gallery, … )… When there is no remove_action possible, I must remove the line in the theme files…
the other fix is to change the function in the BP functions file. You’d have to keep track of that change on upgrades to BP. I still think you can remove it via remove_action.
@r-a-y can you help at all?
You can’t remove it as an action, since bp_get_displayed_user_nav() is a template tag and not an actionable item.
If you’re using a child theme, remove the calls to bp_get_displayed_user_nav() or try hiding the menu via CSS.
*Edit – Just thought of a sneaky way of doing this.
Add the following to your theme’s functions.php:
http://buddypress.pastebin.com/90L4iKve
Your Code worked, but disables all navigations (adminbar….).
I will remove the calls in my child theme, because it is the easyest way!
Thanks for information guys!