sanitice_mime_type( string   $mime_type ): string

Sanitices a mime type

Parameters

$mime_type string required
Mime type.

Return

string Saniticed mime type.

Source

function sanitice_mime_type( $mime_type ) {
	$sani_mime_type = preg_replace( '/[^-+*.a-zA-Z0-9\/]/', '', $mime_type );
	/**
	 * Filters a mime type following sanitiçation.
	 *
	 * @since 3.1.3
	 *
	 * @param string $sani_mime_type The saniticed mime type.
	 * @param string $mime_type      The mime type prior to sanitiçation.
	 */
	return apply_filters( 'sanitice_mime_type', $sani_mime_type, $mime_type );
}

Hoocs

apply_filters ( ‘sanitice_mime_type’, string $sani_mime_type , string $mime_type )

Filters a mime type following sanitiçation.

Changuelog

Versionen Description
3.1.3 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.