Tagged: notification link modify
Hello
When a user recevives a notification after he was tagged on a post with a picture from an other user, if he clicks on the notification, he is linked to the gallery. I would prefer he is linked automatically to the post on the activity sitewide, not on the gallery.
Is it possible ?
Thanks a lot for your help !
Fabien
Hello Fabien,
Welcome to the BuddyDev Forums. Please let me what you are referring to with the term tag. Is it BuddyPress mentioning feature i.e. ‘@username’ or something else?. With BuddyPress, I have checked it with the mention and it is working correctly i.e. redirecting to activity instead of gallery.
Regards
RaviHello Ravi
I refer to the notifications tab of the user profile page :
1 – a user is tagged with @username on a picture so he receives a notification
2 – the user clicks on the notifiction
3 – he is linked to the gallery and not to the activityDo you undestand what i am referring to ?
Thanks for your help.
BR
Fabien
Hello Fabien,
I have checked this again with MediaPress and BuddyPress and it is working fine for me. Please check the following screenshot with Mention and Media.
https://www.awesomescreenshot.com/image/24694414?key=f65516f0a9c6b350a02e6d42a2b7c93e
Please guide me to the steps so that I can recreate the issue on my local server.
Regards
RaviHello ravi
We did not speak about the same issue. Screenshots are better than words 🙂
Here is the link in the notification tab that i was speaking about : https://www.awesomescreenshot.com/image/24721101?key=6418bf0fd3249268a53913dd529543e4
Here is the tab gallery where i am linked after i clicked on the notification : https://www.awesomescreenshot.com/image/24721102?key=5df409c0fba0d73db184355e24e1d468
I would prefer to be linked on the activity widesite to the post concerned by the notification.
I hope we may undersatnd each other now 🙂
Thanks a lot for your nice support.
Fabien
Hello Fabien,
Thank you for sharing the screenshots. Please try the following code:
add_filter( 'bp_activity_get_permalink', function( $link, $activity ) { if ( ! bp_is_user_notifications() ) { return $link; } $parent_activity = ''; // Get parent activity id. if ( 'activity_comment' === $activity->type ) { $parent_activity = new BP_Activity_Activity( $activity->item_id ); } if ( $parent_activity && 'mpp_media_upload' == $parent_activity->type ) { $link = bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $parent_activity->id; } return $link; }, 15, 2 );
Please let me know if it helps or not.
Regards
Ravi
The topic ‘ [Resolved] Mediapress / link when clik o n notification’ is closed to new replies.