Get the display name of the current member in the loop.

Description Description

Full name is, by default, pulled from xprofile’s Full Name field. When this field is empty, we try to get an alternative name from the WP users table, in the following order of preference: display_name, user_nicename, user_login.

Top ↑

Return Return

(string) The user's fullname for display.

Source Source

File: bp-members/bp-members-template.php

	function bp_get_member_name() {
		global $members_template;

		// Generally, this only fires when xprofile is disabled.
		if ( empty( $members_template->member->fullname ) ) {
			// Our order of preference for alternative fullnames.
			$name_stack = array(

			foreach ( $name_stack as $source ) {
				if ( !empty( $members_template->member->{$source} ) ) {
					// When a value is found, set it as fullname and be done with it.
					$members_template->member->fullname = $members_template->member->{$source};

		 * Filters the display name of current member in the loop.
		 * @since 1.2.0
		 * @param string $fullname Display name for current member.
		return apply_filters( 'bp_get_member_name', $members_template->member->fullname );

Top ↑

Changelog Changelog

Version Description
1.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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