embed_thumbnail_id
云策文档标注
概述
embed_thumbnail_id 是一个 WordPress 过滤器,用于在嵌入模板中修改缩略图图像的 ID。它允许开发者自定义或调整嵌入内容时使用的缩略图。
关键要点
- 这是一个过滤器 Hook,名称为 embed_thumbnail_id。
- 参数 $thumbnail_id 可以是附件 ID(整数)或 false(表示没有缩略图)。
- 首次引入于 WordPress 4.9.0 版本。
代码示例
$thumbnail_id = apply_filters( 'embed_thumbnail_id', $thumbnail_id );
原文内容
Filters the thumbnail image ID for use in the embed template.
Parameters
$thumbnail_idint|false-
Attachment ID, or false if there is none.
Source
$thumbnail_id = apply_filters( 'embed_thumbnail_id', $thumbnail_id );
Changelog
| Version | Description |
|---|---|
| 4.9.0 | Introduced. |