Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/07/2013 05:15:51 PM (13 years ago)
Author:
johnjamesjacoby
Message:

First pass at bp-notifications component. Includes:

  • Backwards compatibility for old core functions.
  • Screens, functions, classes, and actions for Notifications.
  • Improved class methods for getting, updating, and deleting notifications.
  • Template parts in bp-legacy for theme compatibility.
  • A few basic unit tests.

@todo's:

  • Improve template output with dedicated functions, markup, classes, et all.
  • More unit tests.
  • Pagination links.
  • Auto-activate on update, so existing installations do not lose previously core functionality.

See #5148. Props johnjamesjacoby, boonebgorges, r-a-y.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-template.php

    r7520 r7521  
    14371437
    14381438/**
     1439 * Check whether the current page is part of the Notifications component.
     1440 *
     1441 * @since BuddyPress (1.9.0)
     1442 *
     1443 * @return bool True if the current page is part of the Notifications component.
     1444 */
     1445function bp_is_notifications_component() {
     1446        if ( bp_is_current_component( 'notifications' ) ) {
     1447                return true;
     1448        }
     1449
     1450        return false;
     1451}
     1452
     1453/**
    14391454 * Check whether the current page is part of the Settings component.
    14401455 *
     
    17461761        if ( bp_is_user_friends() && bp_is_current_action( 'requests' ) )
    17471762                return true;
     1763
     1764        return false;
     1765}
     1766
     1767/**
     1768 * Is this a user's notifications page?
     1769 *
     1770 * Eg http://example.com/members/joe/notifications/ (or a subpage thereof).
     1771 *
     1772 * @since BuddyPress (1.9.0)
     1773 *
     1774 * @return bool True if the current page is a user's Notifications page.
     1775 */
     1776function bp_is_user_notifications() {
     1777        if ( bp_is_user() && bp_is_notifications_component() ) {
     1778                return true;
     1779        }
    17481780
    17491781        return false;
Note: See TracChangeset for help on using the changeset viewer.