BP_REST_Attachments_Member_Avatar_Endpoint::register_routes()
Register the component routes.
Description
Source
File: bp-members/classes/class-bp-rest-attachments-member-avatar-endpoint.php
public function register_routes() {
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/(?P<user_id>[\d]+)/avatar',
array(
'args' => array(
'user_id' => array(
'description' => __( 'A unique numeric ID for the Member.', 'buddyboss' ),
'type' => 'integer',
),
),
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_item' ),
'permission_callback' => array( $this, 'get_item_permissions_check' ),
'args' => $this->get_item_collection_params(),
),
array(
'methods' => WP_REST_Server::CREATABLE,
'callback' => array( $this, 'create_item' ),
'permission_callback' => array( $this, 'create_item_permissions_check' ),
),
array(
'methods' => WP_REST_Server::DELETABLE,
'callback' => array( $this, 'delete_item' ),
'permission_callback' => array( $this, 'delete_item_permissions_check' ),
),
'schema' => array( $this, 'get_item_schema' ),
)
);
}
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.