BP_REST_Group_Membership_Endpoint::get_item_schema()
Get the group member schema, conforming to JSON Schema.
Description Description
Return Return
(array)
Source Source
File: bp-groups/classes/class-bp-rest-group-membership-endpoint.php
public function get_item_schema() { // Get schema from members. $schema = $this->members_endpoint->get_item_schema(); // Set title to this endpoint. $schema['title'] = 'bp_group_members'; $schema['properties']['is_mod'] = array( 'context' => array( 'view', 'edit' ), 'description' => __( '`1` if this member is a Group moderator, `0` otherwise.', 'buddypress' ), 'type' => 'integer', 'enum' => array( 0, 1 ), ); $schema['properties']['is_banned'] = array( 'context' => array( 'view', 'edit' ), 'description' => __( '`1` if this member has been banned from the Group, `0` otherwise.', 'buddypress' ), 'type' => 'integer', 'enum' => array( 0, 1 ), ); $schema['properties']['is_admin'] = array( 'context' => array( 'view', 'edit' ), 'description' => __( '`1` if this member is a Group administrator, `0` otherwise.', 'buddypress' ), 'type' => 'integer', 'enum' => array( 0, 1 ), ); $schema['properties']['is_confirmed'] = array( 'context' => array( 'view', 'edit' ), 'description' => __( '`1` if the membership of this user has been confirmed, `0` otherwise.', 'buddypress' ), 'type' => 'integer', 'enum' => array( 0, 1 ), ); $schema['properties']['date_modified'] = array( 'context' => array( 'view', 'edit' ), 'description' => __( "The date of the last time the membership of this user was modified, in the site's timezone.", 'buddypress' ), 'type' => 'string', 'format' => 'date-time', ); /** * Filters the group membership schema. * * @param array $schema The endpoint schema. */ return apply_filters( 'bp_rest_group_members_schema', $this->add_additional_fields_schema( $schema ) ); }
Changelog Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |