bp_activity_new_at_mention_permalink( $link,  $item_id,  $secondary_item_id )

Generate permalink for comment mention notification.

Description

Parameters

$link

(Required)

$item_id

(Required)

$secondary_item_id

(Required)

Return

(string)

Source

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

function bp_activity_new_at_mention_permalink( $link, $item_id, $secondary_item_id ) {

	$activity_obj = new BP_Activity_Activity( $item_id );

	if ( 'activity_comment' == $activity_obj->type ) {
		$notification = BP_Notifications_Notification::get(
			array(
				'user_id'           => bp_loggedin_user_id(),
				'item_id'           => $item_id,
				'secondary_item_id' => $secondary_item_id,
				'component_name'    => 'activity',
				'component_action'  => 'new_at_mention',
			)
		);

		if ( ! empty( $notification ) ) {
			$id   = current( $notification )->id;
			$link = add_query_arg( 'crid', (int) $id, bp_activity_get_permalink( $activity_obj->id ) );
		}

	}

	return $link;
}

Changelog

Changelog
Version Description
BuddyBoss 1.2.5 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.