BP_REST_Signup_Endpoint::prepare_links( BP_Signup $signup )
Prepare links for the request.
Description
Parameters
- $signup
-
(Required) Signup object.
Return
(array) Links for the given plugin.
Source
File: bp-members/classes/class-bp-rest-signup-endpoint.php
protected function prepare_links( $signup ) {
$base = sprintf( '/%s/%s/', $this->namespace, $this->rest_base );
// Entity meta.
$links = array(
'self' => array(
'href' => rest_url( $base . $signup->user_login ),
),
'collection' => array(
'href' => rest_url( $base ),
),
);
if ( isset( $signup->active ) && empty( $signup->active ) ) {
$links['activate'] = array(
'href' => rest_url( $base . 'activate/' . $signup->user_login ),
);
}
/**
* Filter links prepared for the REST response.
*
* @param array $links The prepared links of the REST response.
* @param BP_Signup $signup Signup object.
*
* @since 0.1.0
*/
return apply_filters( 'bp_rest_signup_prepare_links', $links, $signup );
}
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.