BP_REST_Group_Messages_Endpoint::get_collection_params()
Get the query params for Messages collections.
Description
Return
(array)
Source
File: bp-messages/classes/class-bp-rest-group-messages-endpoint.php
1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 | public function get_collection_params() { $params = parent::get_collection_params(); $params [ 'context' ][ 'default' ] = 'edit' ; unset( $params [ 'page' ], $params [ 'per_page' ], $params [ 'search' ] ); $params [ 'group_id' ] = array ( 'description' => __( 'A unique numeric ID for the Group.' , 'buddyboss' ), 'type' => 'integer' , 'required' => true, 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'message' ] = array ( 'description' => __( 'Content of the Message to add to the Thread.' , 'buddyboss' ), 'type' => 'string' , 'required' => true, 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'users' ] = array ( 'description' => __( 'Group thread users individual or all.' , 'buddyboss' ), 'type' => 'string' , 'required' => true, 'enum' => array ( 'all' , 'individual' ), 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'users_list' ] = array ( 'description' => __( 'Limit result to messages created by a specific user.' , 'buddyboss' ), 'type' => 'array' , 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'bp_rest_sanitize_string_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'type' ] = array ( 'description' => __( 'Type of message, Group thread or private reply.' , 'buddyboss' ), 'type' => 'string' , 'required' => true, 'enum' => array ( 'open' , 'private' ), 'validate_callback' => 'rest_validate_request_arg' , ); /** * Filters the collection query params. * * @param array $params Query params. */ return apply_filters( 'bp_rest_messages_group_collection_params' , $params ); } |
Changelog
Version | Description |
---|---|
0.1.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.