Skip to content

Instantly share code, notes, and snippets.

@pranali333
Last active May 18, 2017 06:13
Show Gist options
  • Save pranali333/835ef8fbde82024f3a727b153118b564 to your computer and use it in GitHub Desktop.
Save pranali333/835ef8fbde82024f3a727b153118b564 to your computer and use it in GitHub Desktop.
Custom code to display the liked media in the BuddyPress activity when other user liked it.
<?php
/**
* rtMedia creates activity post if someone likes the media.
* If anyone wants to display the liked media along with the activity post as well then here is the custom code.
* Thanks to community contributor Ignacio_Duran_Sanz for this.
* You can add this code your theme's functions.php file.
*/
// Adding mediato activity when someone likes it
function rtm_bp_like_activity_action_insert_thumbnail_photo($action, $media_id, $user_id ) {
$activity = new RTMediaActivity( $media_id );
$action .= $activity->create_activity_html();
return $action;
}
add_filter('rtm_bp_like_activity_action', 'rtm_bp_like_activity_action_insert_thumbnail_photo', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment