钩子文档

wp_mime_type_icon

💡 云策文档标注

概述

wp_mime_type_icon 是一个 WordPress 过滤器,用于修改 MIME 类型或附件的图标路径。它允许开发者自定义图标显示,基于 MIME 类型或附件 ID。

关键要点

  • 过滤器名称:wp_mime_type_icon
  • 参数:$icon(图标路径字符串)、$mime(MIME 类型字符串)、$post_id(附件 ID,整数,如果传递 MIME 类型则为 0)
  • 用途:在 wp_mime_type_icon() 函数中调用,用于检索 MIME 类型或附件的图标
  • 引入版本:WordPress 2.1.0

📄 原文内容

Filters the mime type icon.

Parameters

$iconstring
Path to the mime type icon.
$mimestring
Mime type.
$post_idint
Attachment ID. Will equal 0 if the function passed the mime type.

Source

return apply_filters( 'wp_mime_type_icon', $icon, $mime, $post_id );

Changelog

Version Description
2.1.0 Introduced.