W3cubDocs

/WordPress

WP_Font_Utils::apply_sanitizer( mixed $value, callable $sanitizer ): mixed

Applies a sanitizer function to a value.

Parameters

$valuemixedrequired
The value to sanitize.
$sanitizercallablerequired
The sanitizer function to apply.

Return

mixed The sanitized value.

Source

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

	}
	return call_user_func( $sanitizer, $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_font_utils/apply_sanitizer