Edit activity content
-
Hi! I need to add information to activities content because I need to show some information based on activity type, but I can’t make it work
function mmAddLocationCategory($activity_content) { $activity_id = bp_get_activity_id(); $activities = bp_activity_get_specific('activity_ids=' . $activity_id); $activity = $activities['activities'][0]; if ($activity->type){ switch($activity->type){ case "bbp_topic_create": $activity_content = $activity_content . "<p class='activity-action'>" . $activity->action . "</p>"; break; case "updated_profile": $activity_content = $activity_content . '<div class="activity-inner"> <a href="' . bp_activity_user_link() . '">"' . $activity->display_name . '</a>   updated profile details.</div>'; break; case "joined_group": $activity_content = $activity_content . '<div class="activity-inner"> <p class="activity-action">' . $activity->action . '</p> </div>'; break; default: $activity_content = $activity_content . "<div class='activity-inner'>" . $activity->action . "</div>"; break; } } return $activity_content; } add_filter('bp_activity_new_update_content', 'mmAddLocationCategory', 10, 2 );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.