Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/09/2021 04:10:21 AM (4 years ago)
Author:
espellcaste
Message:

Adding support to the offset pagination to Messages and Recipients in a thread.

Previously, the BP_Messages_Thread query class would grab ALL messages created for a thread and ALL its recipients. This commit introduces support to the offset pagination
allowing one to paginate both messages and recipients using parameters with a specific limit and offset.

Props imath
Fixes #8508

File:
1 edited

Legend:

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

    r13096 r13102  
    285285    foreach ( $thread->get_recipients() as $recipient ) {
    286286        foreach ( $message_ids as $message_id ) {
    287             bp_notifications_delete_notifications_by_item_id( $recipient->user_id, (int) $message_id, buddypress()->messages->id, 'new_message' );
     287            if ( ! empty( $recipient->user_id ) ) {
     288                bp_notifications_delete_notifications_by_item_id(
     289                    $recipient->user_id,
     290                    (int) $message_id,
     291                    buddypress()->messages->id,
     292                    'new_message'
     293                );
     294            }
    288295        }
    289296    }
Note: See TracChangeset for help on using the changeset viewer.