get_custom_logo_image_attributes
云策文档标注
概述
本文档介绍了 WordPress 中的 get_custom_logo_image_attributes 过滤器,用于修改自定义徽标图像的属性数组。开发者可以通过此过滤器调整徽标的显示属性,如尺寸、类名等。
关键要点
- 过滤器名称:get_custom_logo_image_attributes
- 参数:$custom_logo_attr(自定义徽标图像属性数组)、$custom_logo_id(自定义徽标附件 ID)、$blog_id(博客 ID)
- 用途:允许开发者过滤和修改自定义徽标的图像属性,例如添加自定义类或调整属性值
- 相关函数:get_custom_logo(),用于获取自定义徽标
- 引入版本:WordPress 5.5.0
代码示例
$custom_logo_attr = apply_filters( 'get_custom_logo_image_attributes', $custom_logo_attr, $custom_logo_id, $blog_id );
原文内容
Filters the list of custom logo image attributes.
Parameters
$custom_logo_attrarray-
Custom logo image attributes.
$custom_logo_idint-
Custom logo attachment ID.
$blog_idint-
ID of the blog to get the custom logo for.
Source
$custom_logo_attr = apply_filters( 'get_custom_logo_image_attributes', $custom_logo_attr, $custom_logo_id, $blog_id );
Changelog
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |