Skip to:
Content

BuddyPress.org

Changeset 7531


Ignore:
Timestamp:
11/08/2013 05:30:50 AM (11 years ago)
Author:
johnjamesjacoby
Message:

Introduce bp_core_mark_notifications_from_user() for completeness, though it's currently unused. Also fix some phpdoc. See #5148.

File:
1 edited

Legend:

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

    r7530 r7531  
    165165}
    166166
     167/**
     168 * Delete all notifications for a user
     169 *
     170 * Used when clearing out all notifications for a user, whene deleted or spammed
     171 *
     172 * @since BuddyPress (1.0)
     173 * @param int $user_id
     174 * @param string $component_name
     175 * @param string $component_action
     176 * @return boolean True on success, false on fail
     177 */
     178function bp_core_delete_notifications_from_user( $user_id, $component_name, $component_action ) {
     179
     180    // Bail if notifications is not active
     181    if ( ! bp_is_active( 'notifications' ) ) {
     182        return false;
     183    }
     184
     185    return bp_notifications_delete_notifications_from_user( $user_id, $component_name, $component_action );
     186}
     187
    167188/** Mark **********************************************************************/
    168189
     
    173194 * has visited that component.
    174195 *
    175  * @since BuddyPress (1.0)
     196 * @since BuddyPress (1.9.0)
    176197 * @param int $user_id
    177198 * @param string $component_name
     
    196217 * has visited that component.
    197218 *
    198  * @since BuddyPress (1.0)
     219 * @since BuddyPress (1.9.0)
    199220 * @param int $user_id
    200221 * @param string $component_name
     
    218239 * Used when clearing out notifications for an entire component
    219240 *
    220  * @since BuddyPress (1.9)
     241 * @since BuddyPress (1.9.0)
    221242 * @param int $user_id
    222243 * @param string $component_name
     
    235256
    236257/**
    237  * Delete all notifications for a user
    238  *
    239  * Used when clearing out all notifications for a user, whene deleted or spammed
    240  *
    241  * @since BuddyPress (1.0)
    242  * @param int $user_id
    243  * @param string $component_name
    244  * @param string $component_action
    245  * @return boolean True on success, false on fail
    246  */
    247 function bp_core_delete_notifications_from_user( $user_id, $component_name, $component_action ) {
    248 
    249     // Bail if notifications is not active
    250     if ( ! bp_is_active( 'notifications' ) ) {
    251         return false;
    252     }
    253 
    254     return bp_notifications_delete_notifications_from_user( $user_id, $component_name, $component_action );
    255 }
     258 * Mark all notifications read/unread from a user
     259 *
     260 * @since BuddyPress (1.9.0)
     261 * @param int $user_id
     262 * @param string $component_name
     263 * @param string $component_action
     264 * @return boolean True on success, false on fail
     265 */
     266function bp_core_mark_notifications_from_user( $user_id, $component_name, $component_action, $is_new = false ) {
     267
     268    // Bail if notifications is not active
     269    if ( ! bp_is_active( 'notifications' ) ) {
     270        return false;
     271    }
     272
     273    return bp_notifications_mark_notifications_from_user( $user_id, $component_name, $component_action, $is_new );
     274}
     275
     276/** Helpers *******************************************************************/
    256277
    257278/**
Note: See TracChangeset for help on using the changeset viewer.