钩子文档

get_header_image_tag

💡 云策文档标注

概述

get_header_image_tag 是一个 WordPress 过滤器,用于修改自定义头部图像的 HTML 标记。它允许开发者过滤和定制图像标签的输出。

关键要点

  • 过滤器名称:get_header_image_tag
  • 参数:$html(HTML 图像标签标记)、$header(自定义头部对象)、$attr(图像标签属性数组)
  • 用途:在 get_header_image_tag() 函数中应用,用于创建自定义头部图像的图像标签标记
  • 引入版本:4.4.0

📄 原文内容

Filters the markup of header images.

Parameters

$htmlstring
The HTML image tag markup being filtered.
$headerobject
The custom header object returned by ‘get_custom_header() ‘.
$attrarray
Array of the attributes for the image tag.

Source

return apply_filters( 'get_header_image_tag', $html, $header, $attr );

Changelog

Version Description
4.4.0 Introduced.