WP_REST_Font_Faces_Controller::sanitize_src
Sanitizes a single src value for a font face.
Method of the class: WP_REST_Font_Faces_Controller{}
No Hooks.
Returns
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
$_FILESarray item.
Changelog
| Since 6.5.0 | Introduced. |
WP_REST_Font_Faces_Controller::sanitize_src() WP REST Font Faces Controller::sanitize src code WP 7.0
protected function sanitize_src( $value ) {
$value = ltrim( $value );
return false === wp_http_validate_url( $value ) ? (string) $value : sanitize_url( $value );
}