消除哑剧类型

原型

sanitize_mime_type( string $mime_type )

参数

$mime_type (string) (Required) 哑剧型

返回值

(string)  消毒哑剧型

源文件

路径:wp-includes/formatting.php

<?php
...
function sanitize_mime_type( $mime_type ) {
	$sani_mime_type = preg_replace( '/[^-+*.a-zA-Z0-9/]/', '', $mime_type );
	/**
	 * Filters a mime type following sanitization.
	 *
	 * @since 3.1.3
	 *
	 * @param string $sani_mime_type The sanitized mime type.
	 * @param string $mime_type      The mime type prior to sanitization.
	 */
	return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type );
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/sanitize_mime_type/