BP_Activity_Activity::append_user_fullnames( array $activities )
Append xProfile fullnames to an activity array.
Description
Parameters
- $activities
-
(Required) Activities array.
Return
(array)
Source
File: bp-activity/classes/class-bp-activity-activity.php
protected static function append_user_fullnames( $activities ) { if ( bp_is_active( 'xprofile' ) && ! empty( $activities ) ) { $activity_user_ids = wp_list_pluck( $activities, 'user_id' ); if ( ! empty( $activity_user_ids ) ) { $fullnames = bp_core_get_user_displaynames( $activity_user_ids ); if ( ! empty( $fullnames ) ) { foreach ( (array) $activities as $i => $activity ) { if ( ! empty( $fullnames[ $activity->user_id ] ) ) { $activities[ $i ]->user_fullname = $fullnames[ $activity->user_id ]; } } } } } return $activities; }
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.