Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/16/2016 12:53:03 PM (10 years ago)
Author:
djpaul
Message:

Notifications: fix bp_notification_before_save filter being called too late to allow changes to notification.

Fixes #7213

Props wordpressrene

File:
1 edited

Legend:

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

    r10789 r11015  
    113113         */
    114114        public function save() {
    115 
    116                 // Return value.
    117115                $retval = false;
    118116
    119                 // Default data and format.
     117                /**
     118                 * Fires before the current notification item gets saved.
     119                 *
     120                 * Please use this hook to filter the properties above. Each part will be passed in.
     121                 *
     122                 * @since 2.0.0
     123                 *
     124                 * @param BP_Notifications_Notification $value Current instance of the notification item being saved. Passed by reference.
     125                 */
     126                do_action_ref_array( 'bp_notification_before_save', array( &$this ) );
     127
    120128                $data = array(
    121129                        'user_id'           => $this->user_id,
     
    128136                );
    129137                $data_format = array( '%d', '%d', '%d', '%s', '%s', '%s', '%d' );
    130 
    131                 /**
    132                  * Fires before the current notification item gets saved.
    133                  *
    134                  * Please use this hook to filter the properties above. Each part will be passed in.
    135                  *
    136                  * @since 2.0.0
    137                  *
    138                  * @param BP_Notifications_Notification $value Current instance of the notification item being saved. Passed by reference.
    139                  */
    140                 do_action_ref_array( 'bp_notification_before_save', array( &$this ) );
    141138
    142139                // Update.
Note: See TracChangeset for help on using the changeset viewer.