Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/26/2014 10:55:04 PM (11 years ago)
Author:
boonebgorges
Message:

Allow all notifications to be fetched by passing 'both' to is_new param of BP_Notifications_Notification::get()

Fixes #5315

Props rodrigorznd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-notifications/bp-notifications-classes.php

    r8154 r8167  
    320320
    321321        // is_new
    322         if ( ! empty( $args['is_new'] ) ) {
    323             $where_conditions['is_new'] = "is_new = 1";
    324         } elseif ( isset( $args['is_new'] ) && ( 0 === $args['is_new'] || false === $args['is_new'] ) ) {
    325             $where_conditions['is_new'] = "is_new = 0";
     322        if ( 'both' !== $args['is_new'] ) {
     323            if ( ! empty( $args['is_new'] ) ) {
     324                $where_conditions['is_new'] = "is_new = 1";
     325            } elseif ( isset( $args['is_new'] ) && ( 0 === $args['is_new'] || false === $args['is_new'] ) ) {
     326                $where_conditions['is_new'] = "is_new = 0";
     327            }
    326328        }
    327329
     
    538540     *     @type string|array $component_action Name of the action to
    539541     *           filter by. Can be an array of actions.
    540      *     @type bool $is_new Whether to limit the query to is_new (unread)
    541      *           notifications. Default: true.
     542     *     @type bool $is_new Whether to limit to new notifications. True
     543     *           returns only new notifications, false returns only non-new
     544     *           notifications. 'both' returns all. Default: true.
    542545     *     @type string $search_terms Term to match against component_name
    543546     *           or component_action fields.
Note: See TracChangeset for help on using the changeset viewer.