Changeset 11818 for trunk/src/bp-xprofile/bp-xprofile-cache.php
- Timestamp:
- 01/25/2018 07:44:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-cache.php
r11352 r11818 189 189 add_action( 'xprofile_group_after_delete', 'xprofile_clear_profile_groups_object_cache' ); 190 190 add_action( 'xprofile_group_after_save', 'xprofile_clear_profile_groups_object_cache' ); 191 192 /**193 * Clear cached XProfile fullname data for user.194 *195 * @since 2.1.0196 *197 * @param int $user_id ID of user whose fullname cache to delete.198 */199 function xprofile_clear_profile_data_object_cache( $user_id = 0 ) {200 wp_cache_delete( 'bp_user_fullname_' . $user_id, 'bp' );201 }202 add_action( 'xprofile_updated_profile', 'xprofile_clear_profile_data_object_cache' );203 204 /**205 * Clear the fullname cache when field 1 is updated.206 *207 * The xprofile_clear_profile_data_object_cache() will make this redundant in most208 * cases, except where the field is updated directly with xprofile_set_field_data().209 *210 * @since 2.0.0211 *212 * @param object $data Data object to clear.213 */214 function xprofile_clear_fullname_cache_on_profile_field_edit( $data ) {215 if ( 1 == $data->field_id ) {216 wp_cache_delete( 'bp_user_fullname_' . $data->user_id, 'bp' );217 }218 }219 add_action( 'xprofile_data_after_save', 'xprofile_clear_fullname_cache_on_profile_field_edit' );220 191 221 192 /**
Note: See TracChangeset
for help on using the changeset viewer.