wp_mime_type_icon
Filter HookDescription
Filters the mime type icon.Hook Information
File Location |
wp-includes/post.php
View on GitHub
|
Hook Type | Filter |
Line Number | 7236 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$icon
|
Path to the mime type icon. |
string
|
$mime
|
Mime type. |
int
|
$post_id
|
Attachment ID. Will equal 0 if the function passed the mime type. |
Usage Examples
Basic Usage
<?php
// Hook into wp_mime_type_icon
add_filter('wp_mime_type_icon', 'my_custom_filter', 10, 3);
function my_custom_filter($icon, $mime, $post_id) {
// Your custom filtering logic here
return $icon;
}
Source Code Context
wp-includes/post.php:7236
- How this hook is used in WordPress core
<?php
7231 * @param string $icon Path to the mime type icon.
7232 * @param string $mime Mime type.
7233 * @param int $post_id Attachment ID. Will equal 0 if the function passed
7234 * the mime type.
7235 */
7236 return apply_filters( 'wp_mime_type_icon', $icon, $mime, $post_id );
7237 }
7238
7239 /**
7240 * Checks for changed slugs for published post objects and save the old slug.
7241 *
PHP Documentation
<?php
/**
* Filters the mime type icon.
*
* @since 2.1.0
*
* @param string $icon Path to the mime type icon.
* @param string $mime Mime type.
* @param int $post_id Attachment ID. Will equal 0 if the function passed
* the mime type.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/post.php
Related Hooks
Related hooks will be displayed here in future updates.