BP_REST_Attachments_Member_Avatar_Endpoint::get_item_collection_params()

Get the query params for the get_item.

Description

Return

(array)

Source

File: bp-members/classes/class-bp-rest-attachments-member-avatar-endpoint.php

525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
public function get_item_collection_params() {
    $params                       = parent::get_collection_params();
    $params['context']['default'] = 'view';
 
    // Removing unused params.
    unset( $params['search'], $params['page'], $params['per_page'] );
 
    $params['html'] = array(
        'description'       => __( 'Whether to return an <img> HTML element, vs a raw URL to an avatar.', 'buddyboss' ),
        'default'           => false,
        'type'              => 'boolean',
        'sanitize_callback' => 'rest_sanitize_boolean',
        'validate_callback' => 'rest_validate_request_arg',
    );
 
    $params['alt'] = array(
        'description'       => __( 'The alt attribute for the <img> element.', 'buddyboss' ),
        'default'           => '',
        'type'              => 'string',
        'sanitize_callback' => 'sanitize_text_field',
        'validate_callback' => 'rest_validate_request_arg',
    );
 
    $params['no_gravatar'] = array(
        'description'       => __( 'Whether to disable the default Gravatar fallback.', 'buddyboss' ),
        'default'           => false,
        'type'              => 'boolean',
        'sanitize_callback' => 'rest_sanitize_boolean',
        'validate_callback' => 'rest_validate_request_arg',
    );
 
    /**
     * Filters the item collection query params.
     *
     * @param array $params Query params.
     */
    return apply_filters( 'bp_rest_attachments_member_avatar_collection_params', $params );
}

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.