WP_REST_Font_Faces_Controller::sanitize_src()protectedWP 6.5.0

Sanitizes a single src value for a font face.

Method of the class: WP_REST_Font_Faces_Controller{}

No Hooks.

Return

String. Sanitized value.

Usage

// protected - for code of main (parent) or child class
$result = $this->sanitize_src( $value );
$value(string) (required)
Font face src that is a URL or the key for a $_FILES array item.

Changelog

Since 6.5.0 Introduced.

WP_REST_Font_Faces_Controller::sanitize_src() code WP 6.6.2

protected function sanitize_src( $value ) {
	$value = ltrim( $value );
	return false === wp_http_validate_url( $value ) ? (string) $value : sanitize_url( $value );
}