Skip to:
Content

BuddyPress.org


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

BP_Messages_Thread: return the *right* latest message.

Introducing a new method get_latest_thread_message() to the BP_Messages_Thread class which returns the latest message of a thread.

Closes https://github.com/buddypress/buddypress/pull/52
Fixes #8696

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/factory.php

    r13108 r13402  
    176176
    177177        $thread_id = messages_new_message( $args );
    178         $thread = new BP_Messages_Thread( $thread_id );
    179         return end( $thread->messages )->id;
     178        $message   = BP_Messages_Thread::get_latest_thread_message( $thread_id );
     179
     180        return $message->id;
    180181    }
    181182
Note: See TracChangeset for help on using the changeset viewer.