WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/sanitize mime type

Description

Sanitize a mime type.

After sanitize_mime_type() has done its work, it passes the sanitized MIME type through the sanitize_mime_type filter.

Usage

<?php sanitize_mime_type( $mime_type ); ?>

Parameters

$mime_type
(string) (required) Mime Type
Default: None

Return Values

(string) 
Sanitized mime type.

Examples

Notes

Filters

  • 'sanitize_mime_type':
    apply_filters( 'sanitize_mime_type', $sanitized_mime_type, $raw_mime_type )

Change Log

Since: 3.1.3

Source File

sanitize_mime_type() is located in /wp-includes/formatting.php.

Related

Functions

sanitize_mime_type() is in a class of functions that help you sanitize potentially unsafe data which allow you to pass an arbitrary variable and receive the clean version based on data type. Others include:

Filters