'default' => array(), ), ), ); } /** * Filters the components schema. * * @param array $schema The endpoint schema. */ return apply_filters( 'bp_rest_components_schema', $this->add_additional_fields_schema( $this->schema ) ); } /** * Get the query params for collections. * * @since 5.0.0 * * @return array */ public function get_collection_params() { $params = parent::get_collection_params(); $params['context']['default'] = 'view'; $params['status'] = array( 'description' => __( 'Limit result set to items with a specific status.', 'buddypress' ), 'default' => 'all', 'type' => 'string', 'enum' => array( 'all', 'active', 'inactive' ), 'sanitize_callback' => 'sanitize_key', 'validate_callback' => 'rest_validate_request_arg', ); $params['type'] = array( 'description' => __( 'Limit result set to items with a specific type.', 'buddypress' ), 'default' => 'all', 'type' => 'string', 'enum' => array( 'all', 'optional', 'retired', 'required' ), 'sanitize_callback' => 'sanitize_key', 'validate_callback' => 'rest_validate_request_arg', ); /** * Filters the collection query params. * * @param array $params Query params. */ return apply_filters( 'bp_rest_components_collection_params', $params ); } }