-
Author
-
March 31, 2014 at 23:55 #13962
Jonbie
ParticipantHi,
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,
April 1, 2014 at 01:09 #13967sharmstr
ModeratorThis 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
April 1, 2014 at 02:10 #13974Jonbie
ParticipantThanks, I couldn’t find a plug-in as its the actual buddypress default menu labels i wanted to change but ill keep looking.
April 1, 2014 at 02:36 #13977sharmstr
ModeratorUnless I’m completely not understanding, the first code snippet in the link I sent you works like a charm.
COPY CODEfunction 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
April 1, 2014 at 02:45 #13986Jonbie
ParticipantIm getting a Parse error: syntax error, unexpected ‘&’ in
April 1, 2014 at 02:51 #13987sharmstr
ModeratorAre 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
April 1, 2014 at 02:56 #13988Jonbie
Participantbrilliant 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’ );April 1, 2014 at 04:06 #13993sharmstr
ModeratorThe 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
April 1, 2014 at 04:17 #13999Jonbie
ParticipantThanks 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?
April 1, 2014 at 05:19 #14002sharmstr
ModeratorJust 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
April 1, 2014 at 06:05 #14008Jonbie
ParticipantThis 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’ );April 1, 2014 at 06:30 #14009sharmstr
ModeratorSorry, I meant ‘function’ not array. Its erroring because you calling the same function.
COPY CODEfunction 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
April 1, 2014 at 06:34 #14010Jonbie
Participantworked perfect,
Thanks for the help and your time Sharmstr.
appreciate it.
April 2, 2014 at 22:21 #14183Abe
KeymasterThank 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. -
AuthorPosts
The topic ‘Change the name of menu/sub menus in wp admin bar dropdown’ is closed to new replies.