Reply To: Is it possible to get the item ID from notification objects?
Hi @godavid33
I’m 99% sure you can. I do believe it’s store in secondary_item_id.
I think you can access it by doing something like this:
$notifications = BP_Notifications_Notification::get( array(
'id' => $notification_id,
'user_id' => $user_id
) );
// I assume there will only be one result but i'll do a loop anyway
if ( $notifications ) {
foreach( $notifications as $notification ) {
// this should output the friendship ID
echo $notification->secondary_item_id;
}
}