[ Index ]

PHP Cross Reference of BuddyPress




/src/bp-xprofile/ -> bp-xprofile-cache.php (summary)

BuddyPress XProfile Caching Functions. Caching functions handle the clearing of cached objects and pages on specific actions throughout BuddyPress.

File Size: 304 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 10 functions


Functions that are not part of a class:

bp_xprofile_get_non_cached_field_ids( $user_id = 0, $field_ids = array()   X-Ref
Determine which xprofile fields do not have cached values for a user.

return: array
since: 2.2.0
param: int   $user_id   User ID to check.
param: array $field_ids XProfile field IDs.

bp_xprofile_update_meta_cache( $object_ids = array()   X-Ref
Slurp up xprofilemeta for a specified set of profile objects.

We do not use bp_update_meta_cache() for the xprofile component. This is
because the xprofile component has three separate object types (group,
field, and data) and three corresponding cache groups. Using the technique
in bp_update_meta_cache(), pre-fetching would take three separate database
queries. By grouping them together, we can reduce the required queries to

This function is called within a bp_has_profile() loop.

return: bool
since: 2.0.0
param: array $object_ids Multi-dimensional array of object_ids, keyed by

xprofile_clear_profile_groups_object_cache( $group_obj )   X-Ref
Clear cached XProfile field group data.

since: 2.1.0
param: object $group_obj Group object to clear.

xprofile_clear_profile_field_object_cache( $field_obj )   X-Ref
Clear caches when a field object is modified.

since: 2.0.0
param: BP_XProfile_Field $field_obj Field object cache to delete.

bp_xprofile_clear_member_type_cache()   X-Ref
Clears member_type cache when a field's member types are updated.

since: 2.4.0

xprofile_clear_profiledata_object_cache( $data_obj )   X-Ref
Clear caches when a user's updates a field data object.

since: 2.0.0
param: BP_XProfile_ProfileData $data_obj Field data object to delete.

xprofile_clear_fullname_field_id_cache()   X-Ref
Clear fullname_field_id cache when bp-xprofile-fullname-field-name is updated.

Note for future developers: Dating from an early version of BuddyPress where
the fullname field (field #1) did not have a title that was editable in the
normal Profile Fields admin interface, we have the bp-xprofile-fullname-field-name
option. In many places throughout BuddyPress, the ID of the fullname field
is queried using this setting. However, this is no longer strictly necessary,
because we essentially hardcode (in the xprofile admin save routine, as well
as the xprofile schema definition) that the fullname field will be 1. The
presence of the non-hardcoded versions (and thus this bit of cache
invalidation) is thus for backward compatibility only.

since: 2.0.0

bp_xprofile_clear_field_cache( $field )   X-Ref
Clear a field's caches.

return: bool False on failure.
since: 2.4.0
param: int|BP_XProfile_Field $field A field ID or a field object.

bp_xprofile_reset_fields_by_name_cache_incrementor()   X-Ref
Clear the field-name cache.

since: 2.8.0

bp_xprofile_reset_groups_cache_incrementor()   X-Ref
Resets all incremented bp_xprofile_groups caches.

since: 5.0.0

Generated: Sat Aug 8 01:01:33 2020 Cross-referenced by PHPXref 0.7.1