bp_core_xprofile_update_profile_completion_user_progress()

Function trigger when profile updated. Profile field added/updated/deleted.

Description

Deletes Profile Completion Transient here.

Source

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

function bp_core_xprofile_update_profile_completion_user_progress() {

	$user_id            = get_current_user_id();
	$steps_options      = bp_core_profile_completion_steps_options();
	$profile_groups     = wp_list_pluck( $steps_options['profile_groups'], 'id' );
	$profile_photo_type = array();

	if ( ! $steps_options['is_profile_photo_disabled'] ) {
		$profile_photo_type[] = 'profile_photo';
	}
	if ( ! $steps_options['is_cover_photo_disabled'] ) {
		$profile_photo_type[] = 'cover_photo';
	}

	// Get logged in user Progress.
	$user_progress_arr = bp_xprofile_get_user_progress( $profile_groups, $profile_photo_type );
	bp_update_user_meta( $user_id, 'bp_profile_completion_widgets', $user_progress_arr );

}

Changelog

Changelog
Version Description
BuddyBoss 1.4.9 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.