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
1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 | 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.