bp_xprofile_filter_user_query_populate_extras( BP_User_Query $user_query, string $user_ids_sql = '' )

Filter BP_User_Query::populate_extras to override each queries users fullname.


Parameters Parameters

$user_query

(BP_User_Query) (Required) User query to filter.

$user_ids_sql

(string) (Optional) SQL statement to use.

Default value: ''


Source Source

File: bp-xprofile/bp-xprofile-filters.php

function bp_xprofile_filter_user_query_populate_extras( BP_User_Query $user_query, $user_ids_sql = '' ) {

	if ( ! bp_is_active( 'xprofile' ) ) {
		return;
	}

	$user_id_names = bp_core_get_user_displaynames( $user_query->user_ids );

	// Loop through names and override each user's fullname.
	foreach ( $user_id_names as $user_id => $user_fullname ) {
		if ( isset( $user_query->results[ $user_id ] ) ) {
			$user_query->results[ $user_id ]->fullname = $user_fullname;
		}
	}
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.