WP_Font_Utils::apply_sanitizerprivate staticWP 6.5.0

Applies a sanitizer function to a value.

Method of the class: WP_Font_Utils{}

No Hooks.

Returns

Mixed. The sanitized value.

Usage

$result = WP_Font_Utils::apply_sanitizer( $value, $sanitizer );
$value(mixed) (required)
The value to sanitize.
$sanitizer(callable) (required)
The sanitizer function to apply.

Changelog

Since 6.5.0 Introduced.

WP_Font_Utils::apply_sanitizer() code WP 6.8.1

private static function apply_sanitizer( $value, $sanitizer ) {
	if ( null === $sanitizer ) {
		return $value;

	}
	return call_user_func( $sanitizer, $value );
}