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