- Timestamp:
- 06/06/2017 05:46:21 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/classes/class-bp-messages-thread.php
r11447 r11578 145 145 } 146 146 147 $user_id = 148 bp_displayed_user_id() ? 149 bp_displayed_user_id() : 150 bp_loggedin_user_id(); 151 147 152 // Merge $args with our defaults. 148 153 $r = wp_parse_args( $args, array( 149 'user_id' => bp_loggedin_user_id(),154 'user_id' => $user_id, 150 155 'update_meta_cache' => true 151 156 ) ); … … 614 619 global $wpdb; 615 620 621 $user_id = 622 bp_displayed_user_id() ? 623 bp_displayed_user_id() : 624 bp_loggedin_user_id(); 625 616 626 $bp = buddypress(); 617 $retval = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 0 WHERE user_id = %d AND thread_id = %d", bp_loggedin_user_id(), $thread_id ) );627 $retval = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 0 WHERE user_id = %d AND thread_id = %d", $user_id, $thread_id ) ); 618 628 619 629 wp_cache_delete( 'thread_recipients_' . $thread_id, 'bp_messages' ); 620 wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );630 wp_cache_delete( $user_id, 'bp_messages_unread_count' ); 621 631 622 632 /** … … 644 654 global $wpdb; 645 655 656 $user_id = 657 bp_displayed_user_id() ? 658 bp_displayed_user_id() : 659 bp_loggedin_user_id(); 660 646 661 $bp = buddypress(); 647 $retval = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 1 WHERE user_id = %d AND thread_id = %d", bp_loggedin_user_id(), $thread_id ) );662 $retval = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 1 WHERE user_id = %d AND thread_id = %d", $user_id, $thread_id ) ); 648 663 649 664 wp_cache_delete( 'thread_recipients_' . $thread_id, 'bp_messages' ); 650 wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );665 wp_cache_delete( $user_id, 'bp_messages_unread_count' ); 651 666 652 667 /**
Note: See TracChangeset
for help on using the changeset viewer.