bp_document_clear_document_user_object_cache_on_delete( array $documents )
Clear a user’s cached document count when delete.
Description
Parameters
- $documents
-
(Required) DB results of document items.
Source
File: bp-document/bp-document-cache.php
function bp_document_clear_document_user_object_cache_on_delete( $documents ) { if ( ! empty( $documents[0] ) ) { foreach ( (array) $documents[0] as $deleted_document ) { $user_id = ! empty( $deleted_document->user_id ) ? $deleted_document->user_id : false; if ( $user_id ) { wp_cache_delete( 'bp_total_document_for_user_' . $user_id, 'bp' ); } } } }
Changelog
Version | Description |
---|---|
BuddyBoss 1.4.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.