bp_xprofile_get_non_cached_field_ids( int $user_id, array $field_ids = array() )

Determine which xprofile fields do not have cached values for a user.

Description

Parameters

$user_id

(int) (Required) User ID to check.

$field_ids

(array) (Optional) XProfile field IDs.

Default value: array()

Return

(array)

Source

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

function bp_xprofile_get_non_cached_field_ids( $user_id = 0, $field_ids = array() ) {
	$uncached_fields = array();

	foreach ( $field_ids as $field_id ) {
		$field_id  = (int) $field_id;
		$cache_key = "{$user_id}:{$field_id}";
		if ( false === wp_cache_get( $cache_key, 'bp_xprofile_data' ) ) {
			$uncached_fields[] = $field_id;
		}
	}

	return $uncached_fields;
}

Changelog

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