bp_activity_at_mention_add_notification( object $activity, string $subject, string $message, string $content, int $receiver_user_id )

Notify a member when their nicename is mentioned in an activity stream item.


Description Description

Hooked to the ‘bp_activity_sent_mention_email’ action, we piggy back off the existing email code for now, since it does the heavy lifting for us. In the future when we separate emails from Notifications, this will need its own ‘bp_activity_at_name_send_emails’ equivalent helper function.


Top ↑

Parameters Parameters

$activity

(object) (Required) Activity object.

$subject

(string) (Required) (not used) Notification subject.

$message

(string) (Required) (not used) Notification message.

$content

(string) (Required) (not used) Notification content.

$receiver_user_id

(int) (Required) ID of user receiving notification.


Source Source

File: bp-activity/bp-activity-notifications.php

function bp_activity_at_mention_add_notification( $activity, $subject, $message, $content, $receiver_user_id ) {
	bp_notifications_add_notification( array(
			'user_id'           => $receiver_user_id,
			'item_id'           => $activity->id,
			'secondary_item_id' => $activity->user_id,
			'component_name'    => buddypress()->activity->id,
			'component_action'  => 'new_at_mention',
			'date_notified'     => bp_core_current_time(),
			'is_new'            => 1,
	) );
}


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.