Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/08/2023 11:03:12 PM (14 months ago)
Author:
espellcaste
Message:

BP_Messages_Thread: return the total number of messages in a thread.

Introducing a new property $messages_total_count to the BP_Messages_Thread class which returns the total number of messages in a thread.

Closes https://github.com/buddypress/buddypress/pull/51
Fixews #8697

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/bp-messages-cache.php

    r13196 r13401  
    5858    wp_cache_delete( $message->thread_id, 'bp_messages_threads' );
    5959
     60    // Delete thread messages count.
     61    wp_cache_delete( "{$message->thread_id}_bp_messages_thread_total_count", 'bp_messages_threads' );
     62
    6063    // Delete unread count for each recipient.
    6164    foreach ( (array) $message->recipients as $recipient ) {
     
    8285        wp_cache_delete( $thread_id, 'bp_messages_threads' );
    8386        wp_cache_delete( "thread_recipients_{$thread_id}", 'bp_messages' );
     87
     88        // Delete thread messages count.
     89        wp_cache_delete( "{$thread_id}_bp_messages_thread_total_count", 'bp_messages_threads' );
    8490    }
    8591
Note: See TracChangeset for help on using the changeset viewer.