BP_REST_Group_Invites_Endpoint::get_item_schema()

Get the group invite schema, conforming to JSON Schema.

Description

Return

(array)

Source

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

	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'bp_group_invites',
			'type'       => 'object',
			'properties' => array(
				'id'            => array(
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'A unique numeric ID for the BP Invitation object.', 'buddyboss' ),
					'type'        => 'integer',
					'readonly'    => true,
				),
				'user_id'       => array(
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'The ID of the user who is invited to join the Group.', 'buddyboss' ),
					'type'        => 'integer',
				),
				'invite_sent'   => array(
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Whether the invite has been sent to the invitee.', 'buddyboss' ),
					'type'        => 'boolean',
				),
				'inviter_id'    => array(
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'The ID of the user who made the invite.', 'buddyboss' ),
					'type'        => 'integer',
				),
				'group_id'      => array(
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'The ID of the group to which the user has been invited.', 'buddyboss' ),
					'type'        => 'integer',
				),
				'date_modified' => array(
					'context'     => array( 'view', 'edit' ),
					'description' => __( "The date the object was created or last updated, in the site's timezone.", 'buddyboss' ),
					'type'        => 'string',
					'format'      => 'date-time',
				),
				'type'          => array(
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Invitation or request.', 'buddyboss' ),
					'type'        => 'string',
					'enum'        => array( 'invite', 'request' ),
					'default'     => 'invite',
				),
				'message'       => array(
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'The raw and rendered versions for the content of the message.', 'buddyboss' ),
					'type'        => 'object',
					'arg_options' => array(
						'sanitize_callback' => null,
						'validate_callback' => null,
					),
					'properties'  => array(
						'raw'      => array(
							'description' => __( 'Content for the object, as it exists in the database.', 'buddyboss' ),
							'type'        => 'string',
							'context'     => array( 'view', 'edit' ),
						),
						'rendered' => array(
							'description' => __( 'HTML content for the object, transformed for display.', 'buddyboss' ),
							'type'        => 'string',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
						),
					),
				),

			),
		);

		/**
		 * Filters the group invites schema.
		 *
		 * @param array $schema The endpoint schema.
		 */
		return apply_filters( 'bp_rest_group_invites_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.