BP_Notifications_Notification::_insert( array $data = array(), array $data_format = array() )

Create a notification entry.


Parameters Parameters

$data

(array) (Optional) Array of notification data, passed to wpdb::insert().

  • 'user_id'
    (int) ID of the associated user.
  • 'item_id'
    (int) ID of the associated item.
  • 'secondary_item_id'
    (int) ID of the secondary associated item.
  • 'component_name'
    (string) Name of the associated component.
  • 'component_action'
    (string) Name of the associated component action.
  • 'date_notified'
    (string) Timestamp of the notification.
  • 'is_new'
    (bool) True if the notification is unread, otherwise false.

Default value: array()

$data_format

(array) (Optional) See wpdb::insert().

Default value: array()


Top ↑

Return Return

(int|false) The number of rows inserted, or false on error.


Source Source

File: bp-notifications/classes/class-bp-notifications-notification.php

	protected static function _insert( $data = array(), $data_format = array() ) {
		global $wpdb;
		return $wpdb->insert( buddypress()->notifications->table_name, $data, $data_format );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.