W3cubDocs

/WordPress

WP_REST_Font_Faces_Controller::sanitize_src( string $value ): string

Sanitizes a single src value for a font face.

Parameters

$valuestringrequired
Font face src that is a URL or the key for a $_FILES array item.

Return

string Sanitized value.

Source

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

Changelog

Version Description
6.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_font_faces_controller/sanitize_src