Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/26/2021 12:53:27 AM (5 years ago)
Author:
espellcaste
Message:

Making PHPDoc Improvements to the BP Messages (component) files.

Also, adding several minor PHP changes.

See #8553

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/classes/class-bp-messages-thread.php

    r13086 r13096  
    213213         */
    214214        public function mark_read() {
    215                 BP_Messages_Thread::mark_as_read( $this->thread_id );
     215                self::mark_as_read( $this->thread_id );
    216216        }
    217217
    … …  
    224224         */
    225225        public function mark_unread() {
    226                 BP_Messages_Thread::mark_as_unread( $this->thread_id );
     226                self::mark_as_unread( $this->thread_id );
    227227        }
    228228
    … …  
    232232         * @since 1.0.0
    233233         * @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.
    234237         *
    235238         * @param int $thread_id The thread ID.
    … …  
    283286         * @since 2.3.0
    284287         *
     288         * @global BuddyPress $bp The one true BuddyPress instance.
     289         * @global wpdb $wpdb WordPress database object.
     290         *
    285291         * @param int $thread_id The message thread ID.
    286292         *
    287          * @return object List of messages associated with a thread.
     293         * @return array List of messages associated with a thread.
    288294         */
    289295        public static function get_messages( $thread_id = 0 ) {
    … …  
    334340         * @since 2.7.0 The $user_id parameter was added. Previously the current user
    335341         *              was always assumed.
     342         *
     343         * @global BuddyPress $bp The one true BuddyPress instance.
     344         * @global wpdb $wpdb WordPress database object.
    336345         *
    337346         * @param int $thread_id The message thread ID.
    … …  
    428437         *
    429438         * @since 1.0.0
     439         *
     440         * @global BuddyPress $bp The one true BuddyPress instance.
     441         * @global wpdb $wpdb WordPress database object.
    430442         *
    431443         * @param array $args {
    … …  
    593605         * @since 2.2.0
    594606         *
     607         * @global wpdb $wpdb WordPress database object.
     608         *
    595609         * @param array $meta_query An array of meta_query filters. See the
    596610         *                          documentation for WP_Meta_Query for details.
    … …  
    624638         * @since 9.0.0 Added the `user_id` parameter.
    625639         *
     640         * @global BuddyPress $bp The one true BuddyPress instance.
     641         * @global wpdb $wpdb WordPress database object.
     642         *
    626643         * @param int $thread_id The message thread ID.
    627644         * @param int $user_id   The user the thread will be marked as read.
    628645         *
    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.
    630647         */
    631648        public static function mark_as_read( $thread_id = 0, $user_id = 0 ) {
    … …  
    665682         * @since 9.0.0 Added the `user_id` parameter.
    666683         *
     684         * @global BuddyPress $bp The one true BuddyPress instance.
     685         * @global wpdb $wpdb WordPress database object.
     686         *
    667687         * @param int $thread_id The message thread ID.
    668688         * @param int $user_id   The user the thread will be marked as unread.
    669689         *
    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.
    671691         */
    672692        public static function mark_as_unread( $thread_id = 0, $user_id = 0 ) {
    … …  
    690710                 *
    691711                 * @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.
    696718                 */
    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 );
    698720
    699721                return $retval;
    … …  
    710732         * @param string $type    The type of messages to get. Either 'all' or 'unread'.
    711733         *                        or 'read'. Defaults to 'all'.
    712          * @return int $value Total thread count for the provided user.
     734         * @return int Total thread count for the provided user.
    713735         */
    714736        public static function get_total_threads_for_user( $user_id, $box = 'inbox', $type = 'all' ) {
    … …  
    736758         * @since 1.0.0
    737759         *
     760         * @global BuddyPress $bp The one true BuddyPress instance.
     761         * @global wpdb $wpdb WordPress database object.
     762         *
    738763         * @param int $thread_id The message thread ID.
    739764         * @return bool
    … …  
    750775                }
    751776
    752                 return in_array( bp_loggedin_user_id(), $sender_ids );
     777                return in_array( bp_loggedin_user_id(), $sender_ids, true );
    753778        }
    754779
    … …  
    757782         *
    758783         * @since 1.0.0
     784         *
     785         * @global BuddyPress $bp The one true BuddyPress instance.
     786         * @global wpdb $wpdb WordPress database object.
    759787         *
    760788         * @param int $thread_id The message thread ID.
    … …  
    778806         * @since 1.0.0
    779807         *
     808         * @global BuddyPress $bp The one true BuddyPress instance.
     809         * @global wpdb $wpdb WordPress database object.
     810         *
    780811         * @param int $user_id The user ID.
    781          * @return int $unread_count Total inbox unread count for user.
     812         * @return int Total inbox unread count for user.
    782813         */
    783814        public static function get_inbox_count( $user_id = 0 ) {
    … …  
    839870         *
    840871         * @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.
    842873         */
    843874        public static function is_valid( $thread_id = 0 ) {
    … …  
    868899         *
    869900         * @param array $recipients Array containing the message recipients (array of objects).
    870          * @return string $value String of message recipent userlinks.
     901         * @return string String of message recipent userlinks.
    871902         */
    872903        public static function get_recipient_links( $recipients ) {
    … …  
    895926         * Upgrade method for the older BP message thread DB table.
    896927         *
     928         * @todo We should remove this. No one is going to upgrade from v1.1, right?
     929         *
    897930         * @since 1.2.0
    898931         *
    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         *
    900935         * @return bool
    901936         */
Note: See TracChangeset for help on using the changeset viewer.