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

Create a notification entry.

Description

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()

Return

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

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 );
	}

Changelog

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.