Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove bp_get_displayed_user_nav() to replace it with a custom function

  • Avatar of sicksight
    sicksight
    Participant

    @sicksight

    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)
  • Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    remove_action( ‘bp_get_displayed_user_nav’ );

    Should be that to remove an action.

    http://codex.buddypress.org/how-to-guides/modifying-the-buddypress-admin-bar/

    Avatar of sicksight
    sicksight
    Participant

    @sicksight

    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.
    http://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!^^

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

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

    Avatar of sicksight
    sicksight
    Participant

    @sicksight

    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…

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    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?

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    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

    Avatar of sicksight
    sicksight
    Participant

    @sicksight

    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)

You must be logged in to reply to this topic.