Reply To: Get Post ID from Notification
Ack my bad! I’m fairly new to php and super new to Buddypress.
Ok soooo … in the file notifications-loop.php inside the loop I’ve added:
$notificationid7 = bp_get_the_notification_id();
$obj = bp_notifications_get_notification( $notificationid7 );
And where I need to display the link (also in notifications-loop.php):
<a href="/pins/<?php echo $obj->item_id; ?>">view</a>
Lastly, where I passed the item ID in bp-notifications-functions.php:
function bp_notifications_add_notification( $args = array() ) {
$r = wp_parse_args( $args, array(
'user_id' => 0,
'item_id' => $post_id,
'secondary_item_id' => 0,
However it’s echoing the notification number … not the post ID.