WordPress at a glance
function is not described

WP_REST_Settings_Controller::sanitize_callback() public WP 4.7.0

Custom sanitize callback used for all options to allow the use of 'null'.

By default, the schema of settings will throw an error if a value is set to null as it's not a valid value for something like "type => string". We provide a wrapper sanitizer to allow the use of null.

{} It's a method of the class: WP_REST_Settings_Controller{}

No Hooks.

Return

Mixed/WP_Error.

Usage

$WP_REST_Settings_Controller = new WP_REST_Settings_Controller();
$WP_REST_Settings_Controller->sanitize_callback( $value, $request, $param );
$value(mixed) (required)
The value for the setting.
$request(WP_REST_Request) (required)
The request object.
$param(string) (required)
The parameter name.

Changelog

Since 4.7.0 Introduced.

Code of WP_REST_Settings_Controller::sanitize_callback() WP 5.5.1

<?php
public function sanitize_callback( $value, $request, $param ) {
	if ( is_null( $value ) ) {
		return $value;
	}

	return rest_parse_request_arg( $value, $request, $param );
}