BP_REST_Account_Settings_Options_Endpoint::get_endpoint_args_for_item_schema( string $method = WP_REST_Server::CREATABLE )
Edit some properties for the CREATABLE & EDITABLE methods.
Description
Parameters
- $method
-
(Optional) HTTP method of the request.
Default value: WP_REST_Server::CREATABLE
Return
(array) Endpoint arguments.
Source
File: bp-settings/classes/class-bp-rest-account-settings-options-endpoint.php
public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
$args = WP_REST_Controller::get_endpoint_args_for_item_schema( $method );
$key = 'get_item';
if ( WP_REST_Server::EDITABLE === $method ) {
$key = 'update_item';
$args = array(
'nav' => array(
'description' => __( 'Navigation item slug.', 'buddyboss' ),
'type' => 'string',
'required' => true,
'sanitize_callback' => 'sanitize_key',
'validate_callback' => 'rest_validate_request_arg',
),
'fields' => array(
'context' => array( 'view', 'edit' ),
'description' => __( 'The list of fields Objects to update with name and value of the field.', 'buddyboss' ),
'type' => 'object',
'required' => true,
),
);
}
/**
* Filters the method query arguments.
*
* @param array $args Query arguments.
* @param string $method HTTP method of the request.
*
* @since 0.1.0
*/
return apply_filters( "bp_rest_update_accounts_{$key}_query_arguments", $args, $method );
}
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.