- Timestamp:
- 10/11/2022 07:22:19 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/10.0/src/bp-messages/classes/class-bp-messages-thread.php
r13196 r13340 201 201 } 202 202 203 // Fetch the recipients .203 // Fetch the recipients and set the displayed/logged in user's unread count. 204 204 $this->recipients = $this->get_recipients( $thread_id, $r ); 205 206 // Get the unread count for the user.207 if ( isset( $this->recipients[ $r['user_id'] ] ) ) {208 $this->unread_count = $this->recipients[ $r['user_id'] ]->unread_count;209 }210 205 211 206 // Grab all message meta. … … 312 307 } 313 308 309 // Set the unread count for the user. 310 if ( isset( $r['user_id'] ) && $r['user_id'] && isset( $recipients[ $r['user_id'] ]->unread_count ) ) { 311 $this->unread_count = (int) $recipients[ $r['user_id'] ]->unread_count; 312 } 313 314 314 // Paginate the results. 315 315 if ( ! empty( $recipients ) && $r['recipients_per_page'] && $r['recipients_page'] ) { 316 316 $start = ( $r['recipients_page'] - 1 ) * ( $r['recipients_per_page'] ); 317 $recipients = array_slice( $recipients, $start, $r['recipients_per_page'] );317 $recipients = array_slice( $recipients, $start, $r['recipients_per_page'], true ); 318 318 } 319 319 … … 757 757 'ASC', 758 758 array( 759 'user_id' => $r['user_id'], 759 760 'update_meta_cache' => false, 760 761 'recipients_page' => $r['recipients_page'],
Note: See TracChangeset
for help on using the changeset viewer.