[buddypress-trac] [BuddyPress Trac] #6712: Screen notifications settings page

buddypress-trac noreply at wordpress.org
Thu Feb 4 00:17:26 UTC 2016


#6712: Screen notifications settings page
---------------------------------------+------------------
 Reporter:  r-a-y                      |       Owner:
     Type:  enhancement                |      Status:  new
 Priority:  normal                     |   Milestone:  2.5
Component:  Component - Notifications  |     Version:  1.9
 Severity:  normal                     |  Resolution:
 Keywords:  has-patch                  |
---------------------------------------+------------------
Changes (by r-a-y):

 * keywords:   => has-patch


Comment:

 `01.patch` implements the "Settings > Notifications" page with the slug
 `screen-notifications`.

 For devs, to register component notification actions, you need to add a
 `'notification_action_callback'` key similar to the existing
 `'notification_callback'` key for formatting notifications.  During the
 callback, you can use `bp_notifications_set_action()` to register each
 notification action.

 When a component does not have any notification actions registered (this
 can be expected for plugins), we fallback to a generic `'Receive screen
 notifications if I select "Yes" for this option'` row.

 This option also serves the purpose of disabling all notifications for a
 component:

 [[Image(https://anonmgur.com/up/e636dcbbfca78d0c3292b79628df2bc6.gif)]]

 This option only shows up if more than one notification action is
 registered for a component.

 I could some use UX feedback for the `'I select "Yes" for this option'`
 text, as I'm not quite satisfied with it.  Some other labels I was mulling
 around include `'Suspend screen notifications'` and `'If I enable them'`.

 ----

 Some other dev notes:

 - Where possible, I've moved all existing email code from
 `bp-X-notifications.php` into `bp-X-functions.php` as emails are
 technically not a part of the Notifications component.
 - `bp-X-notifications.php` is now loaded only if the Notifications
 component is active.
 - For components to set the settings component title, I've created a
 generic, helper function called `bp_notifications_set_prop()` so devs can
 inject any custom properties needed.  View the patch to see how I'm using
 this.
 - For devs to pull up all notification actions, use the
 `bp_notifications_init_registered_actions()` function.  This ensures that
 we only fetch notification actions only when needed.

 Let me know if you have any questions.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6712#comment:5>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list