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