Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am wondering if it's possible to split out notifications in the top bar (the ones that pop up in wp-top bar) to their own individual menu items: 'notifications' 'messages' and 'friend requests', rather than them all being under the notification drop down. Basically I'd like to achieve the effect that Facebook makes with their notifications. If any one could steer me in the right direction I would be most greatful

p.s. I am a front end developer, not the most PHP savvy guy in the world.

:)

share|improve this question

2 Answers 2

Assuming that you are talking about the WP Toolbar, not the BuddyBar. (The basics of doing this for the BuddyBar are the same at the BP level, but the details of rendering the content are different.)

It will be instructive to look at how BP itself builds its Notifications dropdown, in bp_members_admin_bar_notifications_menu() (bp-members/bp-members-adminbar.php). It uses the BP function bp_core_get_notifications_for_user() to call up a list of notifications. Here's the thing about the latter function: Internally, it organizes notifications by type (in order to get counts) before flattening them out again. That means that your strategy would be to build your own version of bp_core_get_notifications_for_user(), borrowing the grouping logic, but then not collapsing all notifications into a single object, but instead returning an object that contains just a certain type of notification (based either on what is called there $notification->component_name or $notification->component_action). Then create new WP Toolbar menus based on the info returned, using exactly the same logic used in bp_members_admin_bar_notifications_menu() but multiplied by three (for Notifications, Messages, and Friend Requests).

I think it would be a reasonable enhancement request for BuddyPress itself that there be a component or action parameter (or both) for bp_core_get_notifications_for_user(). You can leave this request at http://buddypress.trac.wordpress.org if you would like.

share|improve this answer

You could modify the admin bar by hooking into the functions that render it. That would require coding a custom plugin.

Modifying the BuddyPress admin bar

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.