begin_fetch_post_thumbnail_html

动作钩子
do_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size )
参数
  • (int) $post_id The post ID.
    Required:
  • (int) $post_thumbnail_id The post thumbnail ID.
    Required:
  • (string|int[]) $size Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
    Required:
定义位置
相关勾子
end_fetch_post_thumbnail_htmladmin_post_thumbnail_htmlpost_thumbnail_htmlthe_post_thumbnail_captionpost_thumbnail_url
相关方法
_wp_post_thumbnail_htmlwp_ajax_get_post_thumbnail_htmlget_the_post_thumbnail_urlget_post_thumbnail_idget_the_post_thumbnailthe_post_thumbnail_url
引入
2.9.0
弃用
-

begin_fetch_post_thumbnail_html: 这是WordPress的一个动作钩子,在检索一个文章的缩略图HTML之前被触发。begin_fetch_post_thumbnail_html钩子可以用来在文章缩略图被检索之前修改它,允许开发者在文章缩略图的HTML上添加自定义的样式或行为。

在获取文章的缩略图HTML之前启动。

为wp_get_attachment_image()中的所有过滤器提供及时的"过滤。

do_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );

常见问题

FAQs
查看更多 >