- Timestamp:
- 08/26/2021 12:53:27 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/classes/class-bp-messages-thread.php
r13086 r13096 213 213 */ 214 214 public function mark_read() { 215 BP_Messages_Thread::mark_as_read( $this->thread_id );215 self::mark_as_read( $this->thread_id ); 216 216 } 217 217 … … 224 224 */ 225 225 public function mark_unread() { 226 BP_Messages_Thread::mark_as_unread( $this->thread_id );226 self::mark_as_unread( $this->thread_id ); 227 227 } 228 228 … … 232 232 * @since 1.0.0 233 233 * @since 2.3.0 Added $thread_id as a parameter. 234 * 235 * @global BuddyPress $bp The one true BuddyPress instance. 236 * @global wpdb $wpdb WordPress database object. 234 237 * 235 238 * @param int $thread_id The thread ID. … … 283 286 * @since 2.3.0 284 287 * 288 * @global BuddyPress $bp The one true BuddyPress instance. 289 * @global wpdb $wpdb WordPress database object. 290 * 285 291 * @param int $thread_id The message thread ID. 286 292 * 287 * @return objectList of messages associated with a thread.293 * @return array List of messages associated with a thread. 288 294 */ 289 295 public static function get_messages( $thread_id = 0 ) { … … 334 340 * @since 2.7.0 The $user_id parameter was added. Previously the current user 335 341 * was always assumed. 342 * 343 * @global BuddyPress $bp The one true BuddyPress instance. 344 * @global wpdb $wpdb WordPress database object. 336 345 * 337 346 * @param int $thread_id The message thread ID. … … 428 437 * 429 438 * @since 1.0.0 439 * 440 * @global BuddyPress $bp The one true BuddyPress instance. 441 * @global wpdb $wpdb WordPress database object. 430 442 * 431 443 * @param array $args { … … 593 605 * @since 2.2.0 594 606 * 607 * @global wpdb $wpdb WordPress database object. 608 * 595 609 * @param array $meta_query An array of meta_query filters. See the 596 610 * documentation for WP_Meta_Query for details. … … 624 638 * @since 9.0.0 Added the `user_id` parameter. 625 639 * 640 * @global BuddyPress $bp The one true BuddyPress instance. 641 * @global wpdb $wpdb WordPress database object. 642 * 626 643 * @param int $thread_id The message thread ID. 627 644 * @param int $user_id The user the thread will be marked as read. 628 645 * 629 * @return false|int Number of threads marked as read or false on error.646 * @return bool|int Number of threads marked as read or false on error. 630 647 */ 631 648 public static function mark_as_read( $thread_id = 0, $user_id = 0 ) { … … 665 682 * @since 9.0.0 Added the `user_id` parameter. 666 683 * 684 * @global BuddyPress $bp The one true BuddyPress instance. 685 * @global wpdb $wpdb WordPress database object. 686 * 667 687 * @param int $thread_id The message thread ID. 668 688 * @param int $user_id The user the thread will be marked as unread. 669 689 * 670 * @return false|int Number of threads marked as unread or false on error.690 * @return bool|int Number of threads marked as unread or false on error. 671 691 */ 672 692 public static function mark_as_unread( $thread_id = 0, $user_id = 0 ) { … … 690 710 * 691 711 * @since 2.8.0 692 * @since 9.0.0 Added the `user_id` parameter. 693 * 694 * @param int $thread_id The message thread ID. 695 * @param int $user_id The user the thread will be marked as unread. 712 * @since 9.0.0 Added the `$user_id` parameter. 713 * @since 10.0.0 Added the `$retval` parameter. 714 * 715 * @param int $thread_id The message thread ID. 716 * @param int $user_id The user the thread will be marked as unread. 717 * @param bool|int $retval =Number of threads marked as unread or false on error. 696 718 */ 697 do_action( 'messages_thread_mark_as_unread', $thread_id, $user_id );719 do_action( 'messages_thread_mark_as_unread', $thread_id, $user_id, $retval ); 698 720 699 721 return $retval; … … 710 732 * @param string $type The type of messages to get. Either 'all' or 'unread'. 711 733 * or 'read'. Defaults to 'all'. 712 * @return int $valueTotal thread count for the provided user.734 * @return int Total thread count for the provided user. 713 735 */ 714 736 public static function get_total_threads_for_user( $user_id, $box = 'inbox', $type = 'all' ) { … … 736 758 * @since 1.0.0 737 759 * 760 * @global BuddyPress $bp The one true BuddyPress instance. 761 * @global wpdb $wpdb WordPress database object. 762 * 738 763 * @param int $thread_id The message thread ID. 739 764 * @return bool … … 750 775 } 751 776 752 return in_array( bp_loggedin_user_id(), $sender_ids );777 return in_array( bp_loggedin_user_id(), $sender_ids, true ); 753 778 } 754 779 … … 757 782 * 758 783 * @since 1.0.0 784 * 785 * @global BuddyPress $bp The one true BuddyPress instance. 786 * @global wpdb $wpdb WordPress database object. 759 787 * 760 788 * @param int $thread_id The message thread ID. … … 778 806 * @since 1.0.0 779 807 * 808 * @global BuddyPress $bp The one true BuddyPress instance. 809 * @global wpdb $wpdb WordPress database object. 810 * 780 811 * @param int $user_id The user ID. 781 * @return int $unread_countTotal inbox unread count for user.812 * @return int Total inbox unread count for user. 782 813 */ 783 814 public static function get_inbox_count( $user_id = 0 ) { … … 839 870 * 840 871 * @param int $thread_id The message thread ID. 841 * @return false|int|null The message thread ID on success, null on failure.872 * @return bool|int|null The message thread ID on success, null on failure. 842 873 */ 843 874 public static function is_valid( $thread_id = 0 ) { … … 868 899 * 869 900 * @param array $recipients Array containing the message recipients (array of objects). 870 * @return string $valueString of message recipent userlinks.901 * @return string String of message recipent userlinks. 871 902 */ 872 903 public static function get_recipient_links( $recipients ) { … … 895 926 * Upgrade method for the older BP message thread DB table. 896 927 * 928 * @todo We should remove this. No one is going to upgrade from v1.1, right? 929 * 897 930 * @since 1.2.0 898 931 * 899 * @todo We should remove this. No one is going to upgrade from v1.1, right? 932 * @global BuddyPress $bp The one true BuddyPress instance. 933 * @global wpdb $wpdb WordPress database object. 934 * 900 935 * @return bool 901 936 */
Note: See TracChangeset
for help on using the changeset viewer.