bp_activity_format_activity_action_activity_update( string $action, object $activity )
Format ‘activity_update’ activity actions.
Description
Parameters
- $action
-
(Required) Static activity action.
- $activity
-
(Required) Activity data object.
Return
(string) $action
Source
File: bp-activity/bp-activity-functions.php
function bp_activity_format_activity_action_activity_update( $action, $activity ) { if ( bp_activity_do_mentions() && $usernames = bp_activity_find_mentions( $activity->content ) ) { $mentioned_users = array_filter( array_map( 'bp_get_user_by_nickname', $usernames ) ); $mentioned_users_link = array_map( function($mentioned_user) { return bp_core_get_userlink( $mentioned_user->ID ); }, $mentioned_users); $last_user_link = array_pop($mentioned_users_link); $action = sprintf( __( '%s <span class="activity-to">to</span> %s%s%s', 'buddyboss'), bp_core_get_userlink( $activity->user_id ), $mentioned_users_link? implode(', ', $mentioned_users_link) : '', $mentioned_users_link? __(' and ', 'buddyboss') : '', $last_user_link ); } else { $action = sprintf( __( '%s posted an update', 'buddyboss' ), bp_core_get_userlink( $activity->user_id ) ); } /** * Filters the formatted activity action update string. * * @since BuddyPress 1.2.0 * * @param string $action Activity action string value. * @param BP_Activity_Activity $activity Activity item object. */ return apply_filters( 'bp_activity_new_update_action', $action, $activity ); }
Changelog
Version | Description |
---|---|
BuddyPress 2.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.