BP_REST_Media_Albums_Endpoint::get_item_schema()
Get the media album schema, conforming to JSON Schema.
Description
Return
(array)
Source
File: bp-media/classes/class-bp-rest-media-albums-endpoint.php
public function get_item_schema() {
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'bp_media_albums',
'type' => 'object',
'properties' => array(
'id' => array(
'context' => array( 'embed', 'view', 'edit' ),
'description' => __( 'A unique numeric ID for the Album.', 'buddyboss' ),
'readonly' => true,
'type' => 'integer',
),
'user_id' => array(
'context' => array( 'embed', 'view', 'edit' ),
'description' => __( 'The ID for the author of the Album.', 'buddyboss' ),
'readonly' => true,
'type' => 'integer',
),
'group_id' => array(
'context' => array( 'embed', 'view', 'edit' ),
'description' => __( 'A unique numeric ID for the Group.', 'buddyboss' ),
'readonly' => true,
'type' => 'integer',
),
'date_created' => array(
'context' => array( 'embed', 'view', 'edit' ),
'description' => __( 'The date the media was created, in the site\'s timezone.', 'buddyboss' ),
'readonly' => true,
'type' => 'string',
'format' => 'date-time',
),
'title' => array(
'context' => array( 'embed', 'view', 'edit' ),
'description' => __( 'The Album title.', 'buddyboss' ),
'readonly' => true,
'type' => 'string',
),
'privacy' => array(
'context' => array( 'embed', 'view', 'edit' ),
'description' => __( 'Privacy of the media.', 'buddyboss' ),
'enum' => array( 'public', 'loggedin', 'friends', 'onlyme', 'grouponly' ),
'readonly' => true,
'type' => 'string',
),
'media' => array(
'context' => array( 'embed', 'view', 'edit' ),
'description' => __( 'Album\'s media.', 'buddyboss' ),
'readonly' => true,
'type' => 'object',
'properties' => array(
'medias' => array(
'context' => array( 'embed', 'view', 'edit' ),
'description' => __( 'The Album\'s Media.', 'buddyboss' ),
'readonly' => true,
'type' => 'object',
),
),
),
'user_email' => array(
'context' => array( 'embed', 'view', 'edit' ),
'description' => __( 'The user\'s email id to create a media.', 'buddyboss' ),
'readonly' => true,
'type' => 'string',
),
'user_nicename' => array(
'context' => array( 'embed', 'view', 'edit' ),
'description' => __( 'The User\'s nice name to create a media.', 'buddyboss' ),
'readonly' => true,
'type' => 'string',
),
'user_login' => array(
'context' => array( 'embed', 'view', 'edit' ),
'description' => __( 'The User\'s login name to create a media.', 'buddyboss' ),
'readonly' => true,
'type' => 'string',
),
'display_name' => array(
'context' => array( 'embed', 'view', 'edit' ),
'description' => __( 'The User\'s display name to create a media.', 'buddyboss' ),
'readonly' => true,
'type' => 'string',
),
),
);
$schema['properties']['media']['properties']['medias']['properties'] = $this->media_endpoint->get_item_schema()['properties'];
/**
* Filters the media schema.
*
* @param array $schema The endpoint schema.
*/
return apply_filters( 'bp_rest_media_schema', $this->add_additional_fields_schema( $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.