Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom Menu for User’s own profile pages (fixed)


  • MBV
    Participant

    @mbv

    Is it possible to change the menu only for the user’s own profile pages, so that for example, instead of “Profile” it says “My Profile”…?

    I see that with this code, I can change the label as such, but it changes for all pages…

    function mb_profile_menu_tabs(){
    global $bp;
    $bp->bp_nav['profile']['name'] = 'My Profile';
    }
    add_action('bp_setup_nav', 'mb_profile_menu_tabs', 201);

    So, how to specify only for when user is viewing their own profile pages?

    Thanks 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

  • Boone Gorges
    Keymaster

    @boonebgorges

    Here’s how you’d modify the code you’ve provided:

    
    function mb_profile_menu_tabs(){
        global $bp;
        if ( bp_is_my_profile() ) {
            $bp->bp_nav['profile']['name'] = 'My Profile';
        }
    }
    add_action('bp_setup_nav', 'mb_profile_menu_tabs', 201);
    

    MBV
    Participant

    @mbv

    Wow, that’s perfect!

    Thank you so much, Boone!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Menu for User’s own profile pages (fixed)’ is closed to new replies.
Skip to toolbar