內容簡介
Feature Image Extended 是一個擴展特色圖像功能的 WordPress 外掛,可以實現以下功能:
隱藏所有文章類型的特色圖像。
為特色圖像添加連結。
在管理頁面的文章列表中添加縮略圖。
快速編輯特色圖像。
使用方法
安裝外掛後,你可以通過以下方式控制外掛的設置:
通過編程方式使用 featured_image_extended_settings 過濾器(參見下文)。
使用「設置」-「特色圖像擴展」管理頁面。
如果你的佈景主題使用不同於 the_post_thumbnail()/get_the_post_thumbnail() 的調用方式來獲取特色圖像,那麼這個外掛可能無法正常工作。
為了獲取擴展的特色圖像設置並應用於你的頁面,你應該使用 featured_image_extended() (參見下文)。
API
featured_image_extended( integer $post_id = null )
返回包含 $post_id 文章(如果未提供參數則為當前文章)的擴展特色圖像信息的數組,格式如下:
array(
'show' => true,
'url' => 'https://myurl.com',
'target' => '_blank',
'title' => 'Image title',
)
鉤子
featured_image_extended_settings
過濾外掛設置值。
apply_filters( 'featured_image_extended_settings', array $settings )
featured_image_extended_admin_settings
過濾器,允許在管理頁面顯示或隱藏外掛的設置欄。
apply_filters( 'featured_image_extended_admin_settings', boolean $display )
外掛標籤
開發者團隊
原文外掛簡介
Feature Image Extended extends featured image functionality allowing:
Hiding featured image in your themes for all post types.
Adding link to the featured image.
Adding thumbnail featured image in administration screens listing.
Featured image quick-editing.
Usage
Once the plugin is installed you can control settings in the following ways:
Programmatically by using featured_image_extended_settings filter (see below).
Using the Settings->Featured Image Extended administration screen.
If your theme uses a different call other than the_post_thumbnail()/get_the_post_thumbnail() in order to get the featured image, this plugin might not work.
So, in order to get extended featured image settings and apply to your pages, you should use featured_image_extended() (see below).
API
featured_image_extended( integer $post_id = null )
It returns an array containing featured image extended information of $post_id post (or current post if you don’t supply an argument) like following:
array(
'show' => true,
'url' => 'https://myurl.com',
'target' => '_blank',
'title' => 'Image title',
)
Hooks
featured_image_extended_settings
Filter plugin settings values.
apply_filters( 'featured_image_extended_settings', array $settings )
featured_image_extended_admin_settings
Filter allowing to display or not the plugin settings page in the administration.
apply_filters( 'featured_image_extended_admin_settings', boolean $display )
