BP_REST_Media_Details_Endpoint::get_item_schema()

Get the media details schema, conforming to JSON Schema.

Description

Return

(array)

Source

File: bp-media/classes/class-bp-rest-media-details-endpoint.php

122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
public function get_item_schema() {
    $schema = array(
        '$schema'    => 'http://json-schema.org/draft-04/schema#',
        'title'      => 'bp_media_details',
        'type'       => 'object',
        'properties' => array(
            'tabs'    => array(
                'context'     => array( 'embed', 'view' ),
                'description' => __( 'Media directory tabs.', 'buddyboss' ),
                'type'        => 'object',
                'readonly'    => true,
                'items'       => array(
                    'type' => 'array',
                ),
            ),
            'privacy' => array(
                'context'     => array( 'embed', 'view' ),
                'description' => __( 'Media privacy.', 'buddyboss' ),
                'type'        => 'object',
                'readonly'    => true,
            ),
        ),
    );
 
    /**
     * Filters the media details schema.
     *
     * @param array $schema The endpoint schema.
     */
    return apply_filters( 'bp_rest_media_details_schema', $this->add_additional_fields_schema( $schema ) );
}

Changelog

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.