Last active
May 18, 2017 06:13
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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