BP_Members_Component::rest_api_init( array $controllers = array() )

Init the BP REST API.


Parameters Parameters

$controllers

(array) (Optional) See BP_Component::rest_api_init() for description.

Default value: array()


Source Source

File: bp-members/classes/class-bp-members-component.php

	public function rest_api_init( $controllers = array() ) {
		$controllers = array(
			/**
			 * As the Members component is always loaded,
			 * let's register the Components endpoint here.
			 */
			'BP_REST_Components_Endpoint',
			'BP_REST_Members_Endpoint',
			'BP_REST_Attachments_Member_Avatar_Endpoint',
		);

		if ( bp_is_active( 'members', 'cover_image' ) ) {
			$controllers[] = 'BP_REST_Attachments_Member_Cover_Endpoint';
		}

		if ( bp_get_signup_allowed() ) {
			$controllers[] = 'BP_REST_Signup_Endpoint';
		}

		parent::rest_api_init( $controllers );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Adds the Member Cover and Signup REST endpoints.
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.