Good day,
1. Can you please advise if possible to delete a friend’s post from my timeline. Currently a connection can post on my timeline, however I can not delete it. I can only report it. My friend’s post it will show at ‘My connections’.
I can delete a comment from a friend but not entire post.2. I’ve seen in code snippets that you guys added the possibility to show the user avatar when he/she likes a post in Activity Feed? However, I’ve tried it, but it doesnt work. Added in the child theme/functions.php
If you can please advise
Thank you, really appreciate it
Hello Daniel,
Thank you for the details.
1. There is no direct way to implement this with the BuddyBoss Platform. Please contact BuddyBoss they can better guide you with this.
2. Use the following code:
add_action( 'bp_activity_add_user_favorite', 'bpdev_track_user_favorite', 10, 2 ); function bpdev_track_user_favorite( $activity_id, $user_id ) { bp_activity_add_meta( $activity_id, 'favorited_by_user', $user_id ); } add_action( 'bp_activity_remove_user_favorite', 'bpdev_track_user_unfavorite', 10, 2 ); function bpdev_track_user_unfavorite( $activity_id, $user_id ) { bp_activity_delete_meta( $activity_id, 'favorited_by_user', $user_id ); } //show faces, yay! add_action( 'bp_activity_entry_content', 'bpdev_show_who_favorited_activities' ); function bpdev_show_who_favorited_activities() { $output = ''; $favorited_users = bp_activity_get_meta( bp_get_activity_id(), 'favorited_by_user', false ); if ( ! empty( $favorited_users ) ) { foreach ( (array) $favorited_users as $user_id ) { $user_domain = bp_core_get_user_domain( $user_id ); $avatar = bp_core_fetch_avatar( array( 'type' => 'thumb', 'height' => 25, 'width' => 25, 'item_id' => $user_id ) ); $output .= sprintf( '<a href="%s">%s</a>', $user_domain, $avatar ); } } if ( $output ) { echo "<div class='clearfix activity-favorited-by'>{$output}</div>"; } }
Please do let me know if it works or not.
Regards
Ravi
You must be logged in to reply to this topic.