xprofile_update_display_names()

Update member display names.

Description

Source

File: bp-core/admin/bp-core-admin-tools.php

function xprofile_update_display_names() {
	$users = get_users( [
		'fields' => [ 'ID', 'display_name' ]
	] );

	foreach ( $users as $user ) {
		$display_name = bp_custom_display_name_format( $user->display_name, $user->ID );

		wp_update_user( $args = [
			'ID'           => $user->ID,
			'display_name' => $display_name
		] );
	}

	$statement = __( 'Update WordPress user display names; %s', 'buddyboss' );

	return array( 0, sprintf( $statement, __( 'Complete!', 'buddyboss' ) ) );
}

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.