Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/03/2024 05:55:47 PM (8 months ago)
Author:
espellcaste
Message:

Messages: filter threads by recipient IDs.

bp_has_message_threads (and the BP REST API) can filter thread(s) messages by recipient IDs. Very useful when trying to identify if a member already messaged another.

Props imath and slaFFik.

See https://github.com/buddypress/BP-REST/issues/455
Closes https://github.com/buddypress/buddypress/pull/394
See #9229 and #9145
Fixes #9157

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/bp-messages-template.php

    r14061 r14069  
    1919 *
    2020 * @since 1.0.0
     21 * @since 15.0.0 Added the `$includes` parameter.
    2122 *
    2223 * @global BP_Messages_Box_Template $messages_template The message box template loop class.
     
    3233 *     @type string   $type                Type of messages to return. Values: 'all', 'read', 'unread'
    3334 *                                         Default: 'all'
     35 *     @type array    $includes            Filter threads by recipient IDs.
    3436 *     @type string   $search_terms        Terms to which to limit results. Default:
    3537 *                                         the value of $_REQUEST['s'].
     
    8082            'page_arg'            => 'mpage', // See https://buddypress.trac.wordpress.org/ticket/3679.
    8183            'meta_query'          => array(),
     84            'includes'            => array(),
    8285            'recipients_page'     => null,
    8386            'recipients_per_page' => null,
     
    9699     * @since 1.1.0
    97100     *
    98      * @param bool                     $value             Whether or not the message has threads.
     101     * @param bool                     $has_threads       Whether or not the message has threads.
    99102     * @param BP_Messages_Box_Template $messages_template Current message box template object.
    100103     * @param array                    $r                 Array of parsed arguments passed into function.
Note: See TracChangeset for help on using the changeset viewer.