- Timestamp:
- 09/19/2021 03:58:09 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/classes/class-bp-messages-thread.php
r13108 r13112 767 767 } 768 768 769 $bp = buddypress();770 $ 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 ) );769 $bp = buddypress(); 770 $num_rows = $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 ) ); 771 771 772 772 wp_cache_delete( 'thread_recipients_' . $thread_id, 'bp_messages' ); … … 778 778 * @since 2.8.0 779 779 * @since 9.0.0 Added the `user_id` parameter. 780 * @since 10.0.0 Added the `$num_rows` parameter. 780 781 * 781 782 * @param int $thread_id The message thread ID. 782 783 * @param int $user_id The user the thread will be marked as read. 784 * @param bool|int $num_rows Number of threads marked as unread or false on error. 783 785 */ 784 do_action( 'messages_thread_mark_as_read', $thread_id, $user_id );785 786 return $ retval;786 do_action( 'messages_thread_mark_as_read', $thread_id, $user_id, $num_rows ); 787 788 return $num_rows; 787 789 } 788 790 … … 811 813 } 812 814 813 $bp = buddypress();814 $ 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 ) );815 $bp = buddypress(); 816 $num_rows = $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 ) ); 815 817 816 818 wp_cache_delete( 'thread_recipients_' . $thread_id, 'bp_messages' ); … … 822 824 * @since 2.8.0 823 825 * @since 9.0.0 Added the `$user_id` parameter. 824 * @since 10.0.0 Added the `$ retval` parameter.826 * @since 10.0.0 Added the `$num_rows` parameter. 825 827 * 826 828 * @param int $thread_id The message thread ID. 827 829 * @param int $user_id The user the thread will be marked as unread. 828 * @param bool|int $ retval =Number of threads marked as unread or false on error.830 * @param bool|int $num_rows Number of threads marked as unread or false on error. 829 831 */ 830 do_action( 'messages_thread_mark_as_unread', $thread_id, $user_id, $ retval);831 832 return $ retval;832 do_action( 'messages_thread_mark_as_unread', $thread_id, $user_id, $num_rows ); 833 834 return $num_rows; 833 835 } 834 836
Note: See TracChangeset
for help on using the changeset viewer.