Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/02/2021 01:10:12 AM (3 years ago)
Author:
espellcaste
Message:

Adding a user ID parameter to the messages_mark_thread_read and messages_mark_thread_unread functions.

Allowing those functions to be used in other BuddyPress API.

Props imath
Fixes #8489 (trunk)

File:
1 edited

Legend:

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

    r12592 r12984  
    325325 * Wrapper for {@link BP_Messages_Thread::mark_as_read()}.
    326326 *
    327  * @param int $thread_id ID of the thread.
     327 * @since 9.0.0 Added the `user_id` parameter.
     328 *
     329 * @param int $thread_id The message thread ID.
     330 * @param int $user_id   Optional. The user the thread will be marked as read.
    328331 *
    329332 * @return false|int Number of threads marked as read or false on error.
    330333 */
    331 function messages_mark_thread_read( $thread_id ) {
    332     return BP_Messages_Thread::mark_as_read( $thread_id );
     334function messages_mark_thread_read( $thread_id, $user_id = 0 ) {
     335    return BP_Messages_Thread::mark_as_read( $thread_id, $user_id );
    333336}
    334337
     
    338341 * Wrapper for {@link BP_Messages_Thread::mark_as_unread()}.
    339342 *
    340  * @param int $thread_id ID of the thread.
     343 * @since 9.0.0 Added the `user_id` parameter.
     344 *
     345 * @param int $thread_id The message thread ID.
     346 * @param int $user_id   Optional. The user the thread will be marked as unread.
    341347 *
    342348 * @return false|int Number of threads marked as unread or false on error.
    343349 */
    344 function messages_mark_thread_unread( $thread_id ) {
    345     return BP_Messages_Thread::mark_as_unread( $thread_id );
     350function messages_mark_thread_unread( $thread_id, $user_id = 0 ) {
     351    return BP_Messages_Thread::mark_as_unread( $thread_id, $user_id );
    346352}
    347353
Note: See TracChangeset for help on using the changeset viewer.