1. 首页
  2. WordPress 函数手册

get_file_description()

get_file_data( string $file, array $default_headers, string $context =  )

获取标准WordPress主题文件和其他各种标准WordPress文件的说明
Get the description for standard WordPress theme files and other various standard WordPress files

目录锚点:#说明#参数#返回#源码


说明(Description)

在文件的前8 KB中搜索元数据,例如插件或主题。每个元数据都必须在自己的行上。字段不能跨越多行,值将在第一行的末尾被剪切。

如果文件数据不在前8 KB内,则作者应更正其插件文件并将数据头移到顶部。


参数(Parameters)

参数 类型 必填 说明
$file (string) 必需 文件的绝对路径。
$default_headers (array) 必需 格式数组(’HeaderKey’=>’Header Name’)中的标题列表。
$context (string) 可选 如果指定,则添加筛选器挂钩“extra_$context_headers”。

返回(Return)

(string[])由头名称键入的文件头值数组。


源码(Source)


更新版本 源码位置 使用 被使用
2.9.0 wp-admin/includes/file.php:79 1 function 2

get_file_description() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_file_description/