embed_thumbnail_image_shape

過濾鉤子
apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id )
引數
  • (string) $shape Thumbnail image shape. Either 'rectangular' or 'square'.
    Required:
  • (int) $thumbnail_id Attachment ID.
    Required:
定義位置
相關勾子
embed_thumbnail_image_sizeembed_thumbnail_idattachment_thumbnail_argspost_thumbnail_sizeedit_custom_thumbnail_sizes
相關方法
remove_custom_image_headerpost_thumbnail_meta_boxupdate_post_thumbnail_cacheset_post_thumbnail_sizeremove_image_sizehas_image_size
引入
4.5.0
棄用
-

embed_thumbnail_image_shape – 這是WordPress的一個過濾鉤子,用來改變嵌入文章縮圖的形狀。預設行為是使用方形,但這個鉤子允許你指定一個不同的形狀,如圓形、矩形或橢圓形。

過濾在嵌入模板中使用的縮圖形狀。

矩形影象顯示在標題上方,而方形影象則顯示在內容旁邊。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$shape = apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id );
$shape = apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id );
$shape = apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id );

常見問題

FAQs
檢視更多 >