This topic has 13 replies, 3 voices, and was last updated 10 years by Abe.

  • Author
  • #13962
     Jonbie
    Participant

    Hi,

    I would like to change the default name of some of the menu/sub menu items in the wp admin bar (profile to Bio, change avatar to change profile pic etc) I have manged to change the name of the items in the main menu area but i am unable to figure out how to do it for the menu items in the wp admin bar dropdown,

    #13967
     sharmstr
    Moderator

    This is not a theme function. You’ll either have to find a plugin that does it (I’m pretty sure there’s one) or you can do it in your childs function.php file

    http://www.itsabhik.com/rename-wordpress-admin-bar-menus/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #13974
     Jonbie
    Participant

    Thanks, I couldn’t find a plug-in as its the actual buddypress default menu labels i wanted to change but ill keep looking.

    #13977
     sharmstr
    Moderator

    Unless I’m completely not understanding, the first code snippet in the link I sent you works like a charm.

    COPY CODE
    
    function custom_adminbar_titles() {
    	global $wp_admin_bar;
            $wp_admin_bar->add_menu( array(
                    'id'    => 'my-account-xprofile',
                    'title' => 'Bio',
    			) 
    		);
    }
    add_action( 'wp_before_admin_bar_render', 'custom_adminbar_titles' );
    

    That code will change the “Profile” link to “Bio” located in the admin bar menu under “howdy, xxxx”

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #13986
     Jonbie
    Participant

    Im getting a Parse error: syntax error, unexpected ‘&’ in

    #13987
     sharmstr
    Moderator

    Are you sure it was copied complete? I notice sometimes I dont get all the code when I copy from bbpress powered forums.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #13988
     Jonbie
    Participant

    brilliant sharmstr, you were totally right! works perfect. Would i be able to trouble you for the “change avatar” title be changed to “Change Profile Picture”

    function custom_adminbar_titles() {
    global $wp_admin_bar;
    $wp_admin_bar->add_menu( array(
    ‘id’ => ‘change-avatar’,
    ‘title’ => ‘Change Profile Picture’,
    )
    );
    }
    add_action( ‘wp_before_admin_bar_render’, ‘custom_adminbar_titles’ );

    #13993
     sharmstr
    Moderator

    The id is my-account-xprofile-change-avatar

    If you need to know any others, right click on it and inspect it. The id is everything after ‘wp-admin-‘

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #13999
     Jonbie
    Participant

    Thanks for that but it doesnt seem to let me use the code twice? it only change one or the other? it gives me a syntax error when i duplicate the code?

    Any ideas?

    #14002
     sharmstr
    Moderator

    Just add it to the array in the first one. You dont need to redo all the code.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #14008
     Jonbie
    Participant

    This is the code i entered thats giving me the error?

    function custom_adminbar_titles() {
    global $wp_admin_bar;
    $wp_admin_bar->add_menu( array(
    ‘id’ => ‘my-account-xprofile’,
    ‘title’ => ‘Bio’,
    ‘id’ => ‘my-account-xprofile-change-avatar’,
    ‘title’ => ‘Change Profile Picture’,
    )
    );
    }
    add_action( ‘wp_before_admin_bar_render’, ‘custom_adminbar_titles’ );

    #14009
     sharmstr
    Moderator

    Sorry, I meant ‘function’ not array. Its erroring because you calling the same function.

    COPY CODE
    
    
    function custom_adminbar_titles() {
        global $wp_admin_bar;
            $wp_admin_bar->add_menu( array(
                    'id'    => 'my-account-xprofile',
                    'title' => 'Bio',
                ) 
            );
    		
    		$wp_admin_bar->add_menu( array(
                    'id'    => 'my-account-xprofile-change-avatar',
                    'title' => 'Change Profile Picture',
                ) 
            );
    }
    add_action( 'wp_before_admin_bar_render', 'custom_adminbar_titles' );
    
    
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #14010
     Jonbie
    Participant

    worked perfect,

    Thanks for the help and your time Sharmstr.

    appreciate it.

    #14183
     Abe
    Keymaster

    Thank you sharmstr for your help

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 14 posts - 1 through 14 (of 14 total)

The topic ‘Change the name of menu/sub menus in wp admin bar dropdown’ is closed to new replies.

Log in with your credentials

Forgot your details?