BP_REST_Group_Settings_Endpoint::get_item_schema()

Get the group details schema, conforming to JSON Schema.

Description

Return

(array)

Source

File: bp-groups/classes/class-bp-rest-group-settings-endpoint.php

485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
public function get_item_schema() {
    $schema = array(
        '$schema'    => 'http://json-schema.org/draft-04/schema#',
        'title'      => 'bp_groups_details',
        'type'       => 'object',
        'properties' => array(
            'label'       => array(
                'context'     => array( 'embed', 'view' ),
                'description' => __( 'Label for the setting.', 'buddyboss' ),
                'type'        => 'object',
                'readonly'    => true,
                'items'       => array(
                    'type' => 'array',
                ),
            ),
            'name'        => array(
                'context'     => array( 'embed', 'view' ),
                'description' => __( 'Setting field name.', 'buddyboss' ),
                'type'        => 'array',
                'readonly'    => true,
            ),
            'description' => array(
                'context'     => array( 'embed', 'view' ),
                'description' => __( 'Setting field description.', 'buddyboss' ),
                'type'        => 'array',
                'readonly'    => true,
            ),
            'type'        => array(
                'context'     => array( 'embed', 'view' ),
                'description' => __( 'Field type for the setting.', 'buddyboss' ),
                'type'        => 'array',
                'readonly'    => true,
            ),
            'value'       => array(
                'context'     => array( 'embed', 'view' ),
                'description' => __( 'Selected value for the setting.', 'buddyboss' ),
                'type'        => 'array',
                'readonly'    => true,
            ),
            'options'     => array(
                'context'     => array( 'embed', 'view' ),
                'description' => __( 'Available options for the setting.', 'buddyboss' ),
                'type'        => 'array',
                'readonly'    => true,
            ),
        ),
    );
 
    /**
     * Filters the group details schema.
     *
     * @param array $schema The endpoint schema.
     */
    return apply_filters( 'bp_rest_group_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.