BP_Document::append_user_fullnames( array $documents )

Append xProfile fullnames to an document array.

Description

Parameters

$documents

(array) (Required) Documents array.

Return

(array)

Source

File: bp-document/classes/class-bp-document.php

	protected static function append_user_fullnames( $documents ) {

		if ( bp_is_active( 'xprofile' ) && ! empty( $documents ) ) {
			$document_user_ids = wp_list_pluck( $documents, 'user_id' );

			if ( ! empty( $document_user_ids ) ) {
				$fullnames = bp_core_get_user_displaynames( $document_user_ids );
				if ( ! empty( $fullnames ) ) {
					foreach ( (array) $documents as $i => $document ) {
						if ( ! empty( $fullnames[ $document->user_id ] ) ) {
							$documents[ $i ]->user_fullname = $fullnames[ $document->user_id ];
						}
					}
				}
			}
		}

		return $documents;
	}

Changelog

Changelog
Version Description
BuddyBoss 1.4.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.