Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/05/2014 02:15:53 PM (12 years ago)
Author:
boonebgorges
Message:

Add persistent caching support for xprofile field data

See #1332

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-cache.php

    r7782 r7786  
    4040add_action( 'xprofile_fields_deleted_field', 'xprofile_clear_profile_field_object_cache' );
    4141
     42/**
     43 * Clear caches when a user's updates a field data object.
     44 *
     45 * @since BuddyPress (2.0.0)
     46 *
     47 * @param BP_XProfile_ProfileData
     48 */
     49function xprofile_clear_profiledata_object_cache( $data_obj ) {
     50        wp_cache_delete( $data_obj->field_id, 'bp_xprofile_data_' . $data_obj->user_id );
     51}
     52add_action( 'xprofile_data_after_save', 'xprofile_clear_profiledata_object_cache' );
     53add_action( 'xprofile_data_after_delete', 'xprofile_clear_profiledata_object_cache' );
     54
    4255// List actions to clear super cached pages on, if super cache is installed
    4356add_action( 'xprofile_updated_profile', 'bp_core_clear_cache' );
Note: See TracChangeset for help on using the changeset viewer.