Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 3 years ago

#3294 closed defect (bug) (fixed)

WP Admin Bar - Master Ticket

Reported by: johnjamesjacoby Owned by:
Milestone: 1.5 Priority: normal
Severity: normal Version:
Component: Toolbar & Notifications Keywords:
Cc:

Description (last modified by johnjamesjacoby)

Using the WP admin bar in place of the BP BuddyBar is new in 1.3. Use this ticket to report all issues with it before the release of 1.3.

Attachments (3)

3294.1.diff (11.6 KB) - added by boonebgorges 8 years ago.
3294.2.diff (8.7 KB) - added by boonebgorges 8 years ago.
bp-groups-adminbar.patch (603 bytes) - added by needle 8 years ago.

Download all attachments as: .zip

Change History (30)

#1 @johnjamesjacoby
8 years ago

[1. Moderation links are missing for current_item (cannot spam users or groups)] [done]

  1. WP Core quicklinks need to be checked for contextual validity (Why is there an 'Edit Page' link on my profile?)
  2. Dashboard link in dropdown and on main bar (new in WP3.2)
  3. No support for notifications
Last edited 8 years ago by boonebgorges (previous) (diff)

#2 @johnjamesjacoby
8 years ago

  • Component changed from Core to Admin/Buddy Bars

#3 @johnjamesjacoby
8 years ago

  • Description modified (diff)

#4 @boonebgorges
8 years ago

(In [4564]) Don't show 'Edit Page' in WP Admin Bar on BP pages. References #3294

#5 @boonebgorges
8 years ago

I'm working on a patch for (2).

#6 @boonebgorges
8 years ago

Er, I mean (1). The user/group admin menus.

#7 @boonebgorges
8 years ago

As per the discussion in #3302, the extended item admin bar options are being removed for BP 1.3. 3294.1.diff is a patch, for future reference, that puts these items into the WP admin bar.

@boonebgorges
8 years ago

#8 @boonebgorges
8 years ago

(In [4569]) Migrates User Admin moderation menu to the WP Admin Bar. References #3294

#9 @boonebgorges
8 years ago

(In [4570]) Adds Group Admin menu item for WP Admin Bar. References #3294

#10 @boonebgorges
8 years ago

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!

@boonebgorges
8 years ago

#11 @boonebgorges
8 years ago

(In [4620]) Provides initial support for Notifications menu in WP Admin Bar. Refactors group and friendship notifications to return values compatible with the WP Admin Bar constructor. Modifies bp_core_get_notifications_for_user() in order to provide WP Admin Bar support in addition to BuddyBar backpat. References #3294

#12 @boonebgorges
8 years ago

(In [4621]) Adds WP Admin Bar notification support for Activity component. References #3294

#13 @boonebgorges
8 years ago

(In [4622]) Introduces bp_get_messages_slug() and bp_messages_slug() template tags. Ports Messages Component notification items to the WP Admin Bar. References #3294

#14 @boonebgorges
8 years ago

Okay, I think Notifications support is all done. Please open tickets for anything you find missing.

And, actually, I think that everything else mentioned in the original ticket description is done too. JJJ, close?

#15 @boonebgorges
8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4624]) Variable name cleanup to ensure that WP Admin Bar notification items get queued without overlapping each other. Fixes #3294

#16 @luccame
8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I received a friendship_request_notification on testbp.org and it was not clearing when I clicked the link in the admin bar.

I had to add "/?new" at the end of the link to have it cleared.

I think in r4620 you accidentally removed the "/?new" part at the end of the link that should clear the friendship_request_notification in this file:
http://buddypress.trac.wordpress.org/browser/trunk/bp-friends/bp-friends-activity.php

#17 @boonebgorges
8 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [4639]) Ensures that friendship request notifications are cleared when visiting the friend requests page, rather than on accept/reject. Fixes #3294. Props luccame

#18 @johnjamesjacoby
8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Noticed the new Notifications menu has the same ID as Settings > Notifications, which results in two sets of them - one on the root, another in the users settings.

#19 @boonebgorges
8 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [4641]) Changes main Notifications WP Admin Bar menu id, to avoid clashing with Settings > Notifications. Fixes #3294. Props johnjamesjacoby

#20 @johnjamesjacoby
8 years ago

  • Resolution fixed deleted
  • Severity set to normal
  • Status changed from closed to reopened

Back again for single groups and users.

#21 @boonebgorges
8 years ago

Can you be more specific about what's back? I assume you mean the Edit Page button? I'm not able to reproduce.

#22 @boonebgorges
8 years ago

Never mind, I found the issue. It has to do with the way that bp_is_blog_page() works.

#23 @boonebgorges
8 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [5058]) Tweaks bp_is_blog_page() to ensure that it doesn't return true on member home pages, where the current_component may not be set. Fixes #3294

#24 @needle
8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening this as I can't find a better ticket to apply this to. Apologies in advance if I missed something.

In BP 1.5.5 under WP 3.3.1 I see no "Edit Post" button in the WP Admin Bar regardless of context. The attached patch fixes the behaviour as it seems that bp_groups_admin_bar_version_check() removes the wp_admin_bar_edit_menu action globally, rather than under the circumstances that cause the "Edit Group" menu to appear.

#25 @boonebgorges
8 years ago

Thanks for the patch. I think the fix is probably a bit simpler. Since the remove_action() you're referring to is located in the bp-groups-adminbar.php file, we only need to worry about group contexts. And the Edit menu should be removed for *all* users when in that context. FWIW, this is already working properly in BP 1.6 trunk.

In the future, feel free to open new tickets for small issues like this, especially when the more general ticket has been resolved for a while.

#26 @boonebgorges
8 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [5958]) Be more selective about when WP's Edit Page/Post toolbar menu is removed.
Fixes #3294. Props needle

#27 @DJPaul
3 years ago

  • Component changed from General - Toolbar/BuddyBar to Toolbar & Notifications
Note: See TracTickets for help on using tickets.