mirror of
https://gh.wpcy.net/https://github.com/buddypress/buddypress.git
synced 2026-05-31 05:04:29 +08:00
git-svn-id: https://buddypress.svn.wordpress.org/tags/1.5-rc-1@5137 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
30 lines
No EOL
1.1 KiB
PHP
30 lines
No EOL
1.1 KiB
PHP
<?php
|
|
/********************************************************************************
|
|
* Caching
|
|
*
|
|
* Caching functions handle the clearing of cached objects and pages on specific
|
|
* actions throughout BuddyPress.
|
|
*/
|
|
|
|
// Exit if accessed directly
|
|
if ( !defined( 'ABSPATH' ) ) exit;
|
|
|
|
function xprofile_clear_profile_groups_object_cache( $group_obj ) {
|
|
wp_cache_delete( 'xprofile_groups_inc_empty', 'bp' );
|
|
wp_cache_delete( 'xprofile_group_' . $group_obj->id );
|
|
}
|
|
|
|
function xprofile_clear_profile_data_object_cache( $group_id ) {
|
|
global $bp;
|
|
wp_cache_delete( 'bp_user_fullname_' . $bp->loggedin_user->id, 'bp' );
|
|
}
|
|
|
|
// List actions to clear object caches on
|
|
add_action( 'xprofile_groups_deleted_group', 'xprofile_clear_profile_groups_object_cache' );
|
|
add_action( 'xprofile_groups_saved_group', 'xprofile_clear_profile_groups_object_cache' );
|
|
add_action( 'xprofile_updated_profile', 'xprofile_clear_profile_data_object_cache' );
|
|
|
|
// List actions to clear super cached pages on, if super cache is installed
|
|
add_action( 'xprofile_updated_profile', 'bp_core_clear_cache' );
|
|
|
|
?>
|