admin_post_thumbnail_html

过滤钩子
apply_filters( 'admin_post_thumbnail_html', $content, $post->ID, $thumbnail_id )
参数
  • (string) $content Admin post thumbnail HTML markup.
    Required:
  • (int) $post_id Post ID.
    Required:
  • (int|null) $thumbnail_id Thumbnail attachment ID, or null if there isn't one.
    Required:
定义位置
相关勾子
post_thumbnail_htmladmin_post_thumbnail_sizebegin_fetch_post_thumbnail_htmlend_fetch_post_thumbnail_htmlpost_thumbnail_url
相关方法
_wp_post_thumbnail_htmlwp_ajax_get_post_thumbnail_htmlhas_post_thumbnailthe_post_thumbnail_urlget_post_thumbnail_idset_post_thumbnail
引入
4.6.0
弃用
-

admin_post_thumbnail_html。这个过滤钩子是用来修改WordPress文章编辑器中文章缩略图元框的HTML输出的。开发人员可以使用这个钩子为文章缩略图元框添加自定义样式、类或HTML。

过滤管理员文章缩略图的HTML标记返回。

return apply_filters( 'admin_post_thumbnail_html', $content, $post->ID, $thumbnail_id );

常见问题

FAQs
查看更多 >