kampester
Veteran
Just Getting Started
Member Likes (0)
Hi All
I need help to get a custom function working to will remove the 2 default menus in the users Toolbar.
I found this code online and placed it in my themes child folder:
(wp-content/themes/bp-social-child/custom-functions.php
)
// modifies wordpress admin toolbar menuj
function remove_admin_bar_links() {
global $wp_admin_bar; >
$wp_admin_bar->remove_menu('blogs-menu');
$wp_admin_bar->remove_menu('account-menu'); }
add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );
Could not get the above function to work ... hoping someone can point me in the right direction.,
Thanks
Erik

Responses (3)
Member (joined September 2011) Likes (1)Liked by: 
Hi Erik, I am not sure, what "blogs-menu" is ... , but if it is, what I think, then you would just replace
blogs-menu by site-name and
account-menu by my-account
That works here with WP 3.3.2
Have fun!!
Member (joined March 2012) Likes (1)Liked by: 
Thanks Emanaku - that helped, I am getting addicted as I start going through the Wordpress Codex..... over the last 10 years, I have stay-away and resisted to get caught up in the "coding aspect" of my web business, and focusing on the business dev and content, but the power to extend wordpress has become a new joy!!!
Here is my corrected code...
I am really enjoying my new membership at wpmdev .... big thanks to the community!
Cheers! kampester :)
DEV Diva (joined February 2012) Likes (0)
Hi Erik
Glad you got sorted. I actually tried a couple of things myself, but didn't manage to get the results you were looking for. Glad that you got it sorted in the end, with the assistance of Emanaku. So glad for our Community! It is great to see when members help each other.
And great coding on your side!
So enjoy the rest of your weekend and happy continued coding, I guess!
Gina :)
Become a member