xprofile_sync_wp_profile_on_single_field_set( BP_XProfile_ProfileData $data )

Update the WP display, last, and first name fields when the xprofile display name field is updated.

Description

Parameters

$data

(BP_XProfile_ProfileData) (Required) Current instance of the profile data being saved.

Source

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

function xprofile_sync_wp_profile_on_single_field_set( $data ) {
	$synced_fields = array_filter( [
		bp_xprofile_firstname_field_id(),
		bp_xprofile_lastname_field_id(),
		bp_xprofile_nickname_field_id()
	] );

	if ( ! in_array( $data->field_id, $synced_fields ) ) {
		return;
	}

	xprofile_sync_wp_profile( $data->user_id, $data->field_id );
}

Changelog

Changelog
Version Description
BuddyPress 3.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.