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()中的所有過濾器提供及時的"過濾。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
do_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );
do_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );
do_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );

常見問題

FAQs
檢視更多 >