Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove bp_get_displayed_user_nav() to replace it with a custom function

  • @sicksight

    Participant

    Hey!

    Is ist possible to remove the displayed user nav? I don´t find a way to remove it, or filtering it…
    remove_action( ‘???’, ‘bp_get_displayed_user_nav’, 1); ???

    SickSight

Viewing 7 replies - 1 through 7 (of 7 total)
  • @modemlooper

    Moderator

    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/

    @sicksight

    Participant

    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 )! :D :D Like str_replace in php, or something!^^

    @modemlooper

    Moderator

    Why not just remove the code directly from the template file?

    @sicksight

    Participant

    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…

    @modemlooper

    Moderator

    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?

    @r-a-y

    Keymaster

    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

    @sicksight

    Participant

    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! :)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Remove bp_get_displayed_user_nav() to replace it with a custom function’ is closed to new replies.
Skip to toolbar