BP_REST_Group_Membership_Request_Endpoint::get_item_schema()

Get the group membership request schema, conforming to JSON Schema.

Description

Return

(array)

Source

File: bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php

	public function get_item_schema() {

		// Get schema from the membership endpoint.
		$schema = $this->invites_endpoint->get_item_schema();

		// Set title to this endpoint.
		$schema['title'] = 'bp_group_membership_request';

		// Adapt some item schema property descriptions to this endpoint.
		$schema['properties']['user_id']['description']  = __( 'The ID of the user who requested a Group membership.', 'buddyboss' );
		$schema['properties']['group_id']['description'] = __( 'The ID of the group the user requested a membership for.', 'buddyboss' );
		$schema['properties']['type']['default']         = 'request';

		// Remove unused properties.
		unset( $schema['properties']['invite_sent'], $schema['properties']['inviter_id'] );

		/**
		 * Filters the group membership request schema.
		 *
		 * @param array $schema The endpoint schema.
		 */
		return apply_filters( 'bp_rest_group_membership_requests_schema', $this->add_additional_fields_schema( $schema ) );
	}

Changelog

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.