bp_xprofile_replace_username_to_display_name( array $email_content, object|null $user = null )

Change display_name for admin areas.

Description

Parameters

$email_content

(Required) Email Content array.

$user

(Optional) User Object

Default value: null

Return

(array) $email_content Password change email data of array

Source

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

function bp_xprofile_replace_username_to_display_name( $email_content, $user = null ) {
	if ( ! $user || ! is_a( $user, 'WP_User' ) ) {
		$user = wp_get_current_user()->to_array();
	}

	if ( ! isset( $user['ID'] ) || ! isset( $user['display_name'] ) ) {
		return $email_content;
	}

	return str_replace(
		'###USERNAME###',
		bp_custom_display_name_format( $user['display_name'], $user['ID'] ),
		$email_content
	);
}

Changelog

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.