[buddypress-trac] [BuddyPress] #3294: WP Admin Bar - Master Ticket

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Mon Jun 27 15:10:43 UTC 2011


#3294: WP Admin Bar - Master Ticket
-------------------------------+-----------------
  Reporter:  johnjamesjacoby   |      Owner:
      Type:  defect            |     Status:  new
  Priority:  normal            |  Milestone:  1.3
 Component:  Admin/Buddy Bars  |    Version:
Resolution:                    |   Keywords:
-------------------------------+-----------------

Comment (by boonebgorges):

 I've started on (4), the Notifications menu, and I'd like a bit of
 feedback on some tricky spots. See 3294.2.diff, which implements the
 Friends component's notifications into the WP Admin Bar.

 * The old notification callback functions return an HTML link. This won't
 work with WP_Admin_Bar::add_menu(), which takes an 'href' param and builds
 the link itself (see WP_Admin_Bar::recursive_render()). Thus, the
 notification callback function friends_format_notifications(), and the
 helper function bp_members_get_notifications_for_user(), have to be
 modified to return structured data rather than an HTML string. In order to
 maintain backward compatibility with the BuddyBar, I achieved this by
 adding $format arguments.
 * I reconfigured the logic in the callback function
 friends_format_notifications() so that it is a bit more efficient (and
 easy to look at). If everyone is happy with this refactoring, I'll go
 through and apply similar changes to all the notification callbacks. The
 changes are purely internal, and should be backward-compatible with
 plugins that use the old-style format notifications functions.
 * I added just a little bit of backpat code in
 bp_members_get_notifications_for_user() that will try to deal with
 _format_notifications() functions that have not been converted to the new
 format (this will be relevant only for plugins that haven't been updated
 for 1.3). It's minimal, but will ensure that at least the text of the
 notification will be rendered in the dropdown. Again, this is only an
 issue for the WP Admin Bar; plugins will continue to work as expected for
 the BuddyBar.
 * On a slightly more general note, what should we do if we want to add
 additional styles to the WP Admin Bar? Should we load a separate
 stylesheet, like we do with the BuddyBar? Or should we put it in the bp-
 default stylesheets? (I'm thinking little stuff, like the unread
 notification count, which should get a circle-style like WP's unread
 comment count)

 Feedback welcome please!

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3294#comment:10>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list