BP_REST_Group_Membership_Endpoint::get_collection_params()
Get the query params for collections of group memberships.
Description
Return
(array)
Source
File: bp-groups/classes/class-bp-rest-group-membership-endpoint.php
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 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 | public function get_collection_params() { $params = parent::get_collection_params(); $params [ 'context' ][ 'default' ] = 'view' ; $statuses = array ( 'last_joined' , 'first_joined' , 'alphabetical' , 'group_role' ); if ( bp_is_active( 'activity' ) ) { $statuses [] = 'group_activity' ; } $params [ 'status' ] = array ( 'description' => __( 'Sort the order of results by the status of the group members.' , 'buddyboss' ), 'default' => 'last_joined' , 'type' => 'string' , 'enum' => $statuses , 'sanitize_callback' => 'sanitize_key' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'roles' ] = array ( 'description' => __( 'Ensure result set includes specific group roles.' , 'buddyboss' ), 'default' => array (), 'type' => 'array' , 'items' => array ( 'type' => 'string' , 'enum' => array_keys ( bp_groups_get_group_roles() ), ), 'sanitize_callback' => 'bp_rest_sanitize_string_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'exclude' ] = array ( 'description' => __( 'Ensure result set excludes specific member IDs.' , 'buddyboss' ), 'default' => array (), 'type' => 'array' , 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'exclude_admins' ] = array ( 'description' => __( 'Whether results should exclude group admins and mods.' , 'buddyboss' ), 'default' => true, 'type' => 'boolean' , 'sanitize_callback' => 'rest_sanitize_boolean' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'exclude_banned' ] = array ( 'description' => __( 'Whether results should exclude banned group members.' , 'buddyboss' ), 'default' => true, 'type' => 'boolean' , 'sanitize_callback' => 'rest_sanitize_boolean' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'scope' ] = array ( 'description' => __( 'Limit result set to items with a specific scope.' , 'buddyboss' ), 'type' => 'string' , 'context' => array ( 'view' ), 'enum' => array ( 'invite' , 'invite-friends' , 'invited' ), 'sanitize_callback' => 'sanitize_text_field' , 'validate_callback' => 'rest_validate_request_arg' , ); /** * Filters the collection query params. * * @param array $params Query params. */ return apply_filters( 'bp_rest_group_members_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.