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/classes/class-bp-messages-rest-controller.php

    r14061 r14069  
    125125            'type'                => $request->get_param( 'type' ),
    126126            'page'                => $request->get_param( 'page' ),
     127            'includes'            => $request->get_param( 'includes' ),
    127128            'per_page'            => $request->get_param( 'per_page' ),
    128129            'search_terms'        => $request->get_param( 'search' ),
     
    15401541
    15411542        $params['box'] = array(
    1542             'description'       => __( 'Filter the result by box.', 'buddypress' ),
     1543            'description'       => __( 'Filter threads by the mailbox type.', 'buddypress' ),
    15431544            'default'           => 'inbox',
    15441545            'type'              => 'string',
     
    15491550
    15501551        $params['type'] = array(
    1551             'description'       => __( 'Filter the result by thread status.', 'buddypress' ),
     1552            'description'       => __( 'Filter threads by the status.', 'buddypress' ),
    15521553            'default'           => 'all',
    15531554            'type'              => 'string',
     
    15631564            'required'          => true,
    15641565            'sanitize_callback' => 'absint',
     1566            'validate_callback' => 'rest_validate_request_arg',
     1567        );
     1568
     1569        $params['includes'] = array(
     1570            'description'       => __( 'Filter threads by recipient IDs.', 'buddypress' ),
     1571            'default'           => array(),
     1572            'type'              => 'array',
     1573            'sanitize_callback' => 'wp_parse_id_list',
    15651574            'validate_callback' => 'rest_validate_request_arg',
    15661575        );
Note: See TracChangeset for help on using the changeset viewer.