BP_REST_XProfile_Field_Groups_Endpoint::prepare_links( BP_XProfile_Group $group )

Prepare links for the request.


Parameters Parameters

$group

(BP_XProfile_Group) (Required) XProfile field group.


Top ↑

Return Return

(array)


Source Source

File: bp-xprofile/classes/class-bp-rest-xprofile-field-groups-endpoint.php

	protected function prepare_links( $group ) {
		$base = sprintf( '/%s/%s/', $this->namespace, $this->rest_base );

		// Entity meta.
		$links = array(
			'self'       => array(
				'href' => rest_url( $base . $group->id ),
			),
			'collection' => array(
				'href' => rest_url( $base ),
			),
		);

		/**
		 * Filter links prepared for the REST response.
		 *
		 * @since 5.0.0
		 *
		 * @param array            $links The prepared links of the REST response.
		 * @param BP_XProfile_Group $group XProfile field group object.
		 */
		return apply_filters( 'bp_rest_xprofile_field_groups_prepare_links', $links, $group );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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