Unfortunately, there’s no hook in the “My Account” menu to add custom items so you’ll basically need to duplicate the bp_adminbar_account_menu() and add your changes, then remove the bp_adminbar_account_menu() function and add your custom function.
The following guide tells you how to do this:
https://codex.buddypress.org/how-to-guides/modifying-the-buddypress-admin-bar/
Thanks Ray I did read that but I did not seem to understand it. I just want to put a link in there that Say write post and it links to
http://sitename.com/wp-admin/post-new.php
Any ideas?
Or I could have a link outside the bar and next to the Home,Members,Groups ETC but I only want logged in users to be able to see the link. Like this:
Home, Write A Post, Members, Groups
And when users are not logged in they don’t see Write A Post.
I have included this code in the header.php and the link is there but how do I change it to only allow logged in users to see it?
<li<?php if ( bp_is_front_page() ) : ?>class=”selected”<?php endif; ?>>
“><?php _e( ‘Write A Post’, ‘buddypress’ ) ?>
Use:
<php if(is_user_logged_in()) : ?>YOUR LINK<?php endif; ?>