BP_Notifications_Notification::update( array $update_args = array(), array $where_args = array() )
Update notifications.
Description
See also
- BP_Notifications_Notification::get(): for a description of accepted update/where arguments.
Parameters
- $update_args
-
(Optional) Associative array of fields to update, and the values to update them to. Of the format array( 'user_id' => 4, 'component_name' => 'groups', ).
Default value: array()
- $where_args
-
(Optional) Associative array of columns/values, to determine which rows should be updated. Of the format array( 'item_id' => 7, 'component_action' => 'members', ).
Default value: array()
Return
(int|false) Number of rows updated on success, false on failure.
Source
File: bp-notifications/classes/class-bp-notifications-notification.php
public static function update( $update_args = array(), $where_args = array() ) {
$update = self::get_query_clauses( $update_args );
$where = self::get_query_clauses( $where_args );
/**
* Fires before the update of a notification item.
*
* @since BuddyPress 2.3.0
*
* @param array $update_args See BP_Notifications_Notification::update().
* @param array $where_args See BP_Notifications_Notification::update().
*/
do_action( 'bp_notification_before_update', $update_args, $where_args );
return self::_update(
$update['data'],
$where['data'],
$update['format'],
$where['format']
);
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 1.9.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.