WordPress at a glance
function is not described

WP_Widget_Media::sanitize_token_list() public WP 4.8.0

Sanitize a token list string, such as used in HTML rel and class attributes.

{} It's a method of the class: WP_Widget_Media{}

No Hooks.

Return

String. Sanitized token string list.

Usage

$WP_Widget_Media = new WP_Widget_Media();
$WP_Widget_Media->sanitize_token_list( $tokens );
$tokens(string|array) (required)
List of tokens separated by spaces, or an array of tokens.

Changelog

Since 4.8.0 Introduced.

Code of WP_Widget_Media::sanitize_token_list() WP 5.7.2

<?php
public function sanitize_token_list( $tokens ) {
	if ( is_string( $tokens ) ) {
		$tokens = preg_split( '/\s+/', trim( $tokens ) );
	}
	$tokens = array_map( 'sanitize_html_class', $tokens );
	$tokens = array_filter( $tokens );
	return implode( ' ', $tokens );
}