BP_REST_Components_Endpoint::get_item_schema()

Get the components schema, conforming to JSON Schema.

Description

Return

(array)

Source

File: bp-core/classes/class-bp-rest-components-endpoint.php

464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
public function get_item_schema() {
    $schema = array(
        '$schema'    => 'http://json-schema.org/draft-04/schema#',
        'title'      => 'bp_components',
        'type'       => 'object',
        'properties' => array(
            'name'        => array(
                'context'     => array( 'view', 'edit' ),
                'description' => __( 'Name of the object.', 'buddyboss' ),
                'type'        => 'string',
            ),
            'status'      => array(
                'context'     => array( 'view', 'edit' ),
                'description' => __( 'Whether the object is active or inactive.', 'buddyboss' ),
                'type'        => 'string',
                'enum'        => array( 'active', 'inactive' ),
            ),
            'title'       => array(
                'context'     => array( 'view', 'edit' ),
                'description' => __( 'HTML title of the object.', 'buddyboss' ),
                'type'        => 'string',
            ),
            'description' => array(
                'context'     => array( 'view', 'edit' ),
                'description' => __( 'HTML description of the object.', 'buddyboss' ),
                'type'        => 'string',
            ),
        ),
    );
 
    /**
     * Filters the components schema.
     *
     * @param string $schema The endpoint schema.
     */
    return apply_filters( 'bp_rest_components_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.