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.


Parameters Parameters

$user_id

(int) (Required) User ID to check.

$field_ids

(array) (Optional) XProfile field IDs.

Default value: array()


Top ↑

Return Return

(array)


Source 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;
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.