Changeset 8200 for trunk/bp-groups/bp-groups-cache.php
- Timestamp:
- 03/29/2014 12:35:30 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/bp-groups/bp-groups-cache.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-cache.php
r7956 r8200 113 113 114 114 /** 115 * Clear a user's cached total group invite count. 116 * 117 * Count is cleared when an invite is accepted, rejected or deleted. 118 * 119 * @since BuddyPress (2.0.0) 120 * 121 * @param int $user_id The user ID. 122 */ 123 function bp_groups_clear_invite_count_for_user( $user_id ) { 124 wp_cache_delete( $user_id, 'bp_group_invite_count' ); 125 } 126 add_action( 'groups_accept_invite', 'bp_groups_clear_invite_count_for_user' ); 127 add_action( 'groups_reject_invite', 'bp_groups_clear_invite_count_for_user' ); 128 add_action( 'groups_delete_invite', 'bp_groups_clear_invite_count_for_user' ); 129 130 /** 131 * Clear a user's cached total group invite count when a user is uninvited. 132 * 133 * Groan. Our API functions are not consistent. 134 * 135 * @since BuddyPress (2.0.0) 136 * 137 * @param int $group_id The group ID. Not used in this function. 138 * @param int $user_id The user ID. 139 */ 140 function bp_groups_clear_invite_count_on_uninvite( $group_id, $user_id ) { 141 bp_groups_clear_invite_count_for_user( $user_id ); 142 } 143 add_action( 'groups_uninvite_user', 'bp_groups_clear_invite_count_on_uninvite', 10, 2 ); 144 145 /** 146 * Clear a user's cached total group invite count when a new invite is sent. 147 * 148 * @since BuddyPress (2.0.0) 149 * 150 * @param int $group_id The group ID. Not used in this function. 151 * @param array $invited_users Array of invited user IDs. 152 */ 153 function bp_groups_clear_invite_count_on_send( $group_id, $invited_users ) { 154 foreach ( $invited_users as $user_id ) { 155 bp_groups_clear_invite_count_for_user( $user_id ); 156 } 157 } 158 add_action( 'groups_send_invites', 'bp_groups_clear_invite_count_on_send', 10, 2 ); 159 160 /** 115 161 * Clear a user's cached group count. 116 162 * 117 * @param int $group_id ID of the group. Not used in this function.118 * @param int $user_id ID of the user whose group count is being changed.163 * @param int $group_id The group ID. Not used in this function. 164 * @param int $user_id The user ID. 119 165 */ 120 166 function groups_clear_group_user_object_cache( $group_id, $user_id ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)