Changeset 10198 for trunk/src/bp-xprofile/bp-xprofile-cache.php
- Timestamp:
- 10/07/2015 02:30:31 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-cache.php
r10163 r10198 284 284 add_action( 'update_option_bp-xprofile-fullname-field-name', 'xprofile_clear_fullname_field_id_cache' ); 285 285 286 /** 287 * Clear a field's caches. 288 * 289 * @since 2.4.0 290 * 291 * @param int|BP_XProfile_Field A field ID or a field object. 292 * @param bool False on failure. 293 */ 294 function bp_xprofile_clear_field_cache( $field ) { 295 if ( is_numeric( $field ) ) { 296 $field_id = (int) $field; 297 } elseif ( $field instanceof BP_XProfile_Field ) { 298 $field_id = (int) $field->id; 299 } 300 301 if ( ! isset( $field_id ) ) { 302 return false; 303 } 304 305 wp_cache_delete( $field_id, 'bp_xprofile_fields' ); 306 wp_cache_delete( $field_id, 'xprofile_meta' ); 307 } 308 add_action( 'xprofile_field_after_save', 'bp_xprofile_clear_field_cache' ); 309 286 310 // List actions to clear super cached pages on, if super cache is installed. 287 311 add_action( 'xprofile_updated_profile', 'bp_core_clear_cache' );
Note: See TracChangeset
for help on using the changeset viewer.