Filter hook 'sanitize_mime_type'

in WP Core File wp-includes/formatting.php at line 5728

View Source

sanitize_mime_type

Filter Hook
Description
Filters a mime type following sanitization.

Hook Information

File Location wp-includes/formatting.php View on GitHub
Hook Type Filter
Line Number 5728

Hook Parameters

Type Name Description
string $sani_mime_type The sanitized mime type.
string $mime_type The mime type prior to sanitization.

Usage Examples

Basic Usage
<?php
// Hook into sanitize_mime_type
add_filter('sanitize_mime_type', 'my_custom_filter', 10, 2);

function my_custom_filter($sani_mime_type, $mime_type) {
    // Your custom filtering logic here
    return $sani_mime_type;
}

Source Code Context

wp-includes/formatting.php:5728 - How this hook is used in WordPress core
<?php
5723  	 * @since 3.1.3
5724  	 *
5725  	 * @param string $sani_mime_type The sanitized mime type.
5726  	 * @param string $mime_type      The mime type prior to sanitization.
5727  	 */
5728  	return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type );
5729  }
5730  
5731  /**
5732   * Sanitizes space or carriage return separated URLs that are used to send trackbacks.
5733   *

PHP Documentation

<?php
/**
	 * 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.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/formatting.php
Related Hooks

Related hooks will be displayed here in future updates.