Skip to:
Content

BuddyPress.org


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

Introduce bp_core_mark_all_notifications_by_type() and replace bp_core_delete_all_notifications_by_type() usages. Ensures notifications are toggled as acknowledged rather than deleted. See #5148.

File:
1 edited

Legend:

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

    r7528 r7529  
    300300 *
    301301 * @param int $user_id ID of the user whose notifications are being deleted.
    302  * @param int $is_new 0 for read, 1 for unread
    303  * @param string $component_name Name of the associated component.
    304  * @param string $component_action Name of the associated action.
    305  * @return bool True on success, false on failure.
    306  */
    307 function bp_notifications_mark_notifications_by_type( $user_id, $is_new, $component_name, $component_action ) {
     302 * @param string $component_name Name of the associated component.
     303 * @param string $component_action Name of the associated action.
     304 * @param int $is_new 0 for read, 1 for unread
     305 * @return bool True on success, false on failure.
     306 */
     307function bp_notifications_mark_notifications_by_type( $user_id, $component_name, $component_action, $is_new = false ) {
    308308    return BP_Notifications_Notification::delete( array(
    309309        'user_id'          => $user_id,
     
    324324 * @param int $user_id ID of the user whose notifications are being deleted.
    325325 * @param int $item_id ID of the associated item.
    326  * @param int $is_new 0 for read, 1 for unread
    327326 * @param string $component_name Name of the associated component.
    328327 * @param string $component_action Name of the associated action.
    329328 * @param int $secondary_item_id ID of the secondary associated item.
    330  * @return bool True on success, false on failure.
    331  */
    332 function bp_notifications_mark_notifications_by_item_id( $user_id, $item_id, $is_new, $component_name, $component_action, $secondary_item_id = false ) {
     329 * @param int $is_new 0 for read, 1 for unread
     330 * @return bool True on success, false on failure.
     331 */
     332function bp_notifications_mark_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false, $is_new = false ) {
    333333    return BP_Notifications_Notification::delete( array(
    334334        'user_id'           => $user_id,
     
    353353 * @param string $component_action Optional. Name of the associated action.
    354354 * @param int $secondary_item_id Optional. ID of the secondary associated item.
    355  * @return bool True on success, false on failure.
    356  */
    357 function bp_notifications_mark_all_notifications_by_type( $item_id, $is_new, $component_name, $component_action = false, $secondary_item_id = false ) {
     355 * @param int $is_new 0 for read, 1 for unread
     356 * @return bool True on success, false on failure.
     357 */
     358function bp_notifications_mark_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false, $is_new = false ) {
    358359    return BP_Notifications_Notification::delete( array(
    359360        'item_id'           => $item_id,
     
    380381 * @param string $component_name Name of the associated component.
    381382 * @param string $component_action Name of the associated action.
    382  * @return bool True on success, false on failure.
    383  */
    384 function bp_notifications_mark_notifications_from_user( $user_id, $is_new, $component_name, $component_action ) {
     383 * @param int $is_new 0 for read, 1 for unread
     384 * @return bool True on success, false on failure.
     385 */
     386function bp_notifications_mark_notifications_from_user( $user_id, $component_name, $component_action, $is_new = false ) {
    385387    return BP_Notifications_Notification::delete( array(
    386388        'item_id'          => $user_id,
Note: See TracChangeset for help on using the changeset viewer.