Changeset 11578 for trunk/src/bp-messages/bp-messages-cache.php
- Timestamp:
- 06/06/2017 05:46:21 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-cache.php
r10417 r11578 75 75 * @param int|array $thread_ids If single thread, the thread ID. 76 76 * Otherwise, an array of thread IDs. 77 * @param int $user_id ID of the user that the threads were deleted for. 77 78 */ 78 function bp_messages_clear_cache_on_message_delete( $thread_ids ) {79 function bp_messages_clear_cache_on_message_delete( $thread_ids, $user_id ) { 79 80 // Delete thread and thread recipient cache. 80 81 foreach( (array) $thread_ids as $thread_id ) { … … 84 85 85 86 // Delete unread count for logged-in user. 86 wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );87 wp_cache_delete( $user_id, 'bp_messages_unread_count' ); 87 88 } 88 add_action( 'messages_delete_thread', 'bp_messages_clear_cache_on_message_delete' );89 add_action( 'messages_delete_thread', 'bp_messages_clear_cache_on_message_delete', 10, 2 ); 89 90 90 91 /**
Note: See TracChangeset
for help on using the changeset viewer.