內容簡介
Enforce Featured Image 是一個提供 API 的外掛,用於強制發佈某些文章類型時必須包含特定尺寸的特色圖片。
使用方法
在你的主題的 functions.php 檔案中撰寫插件代碼或直接貼上以下範例:
if ( class_exists( 'Enforce_Featured_Image' ) ) {
Enforce_Featured_Image::enforce_on_post_type( 'post', array(
'min_width' => 640,
'min_height' => 300,
'force_on_published_posts' => false,
) );
}
注意: 你可以使用 Code Snippets 外掛來添加代碼片段到你的網站。
開發者
此外掛基於 XWP 的 Force Featured Image 外掛開發而成。
貢獻
開發者可以透過 Github 儲存庫 貢獻原始碼。
外掛標籤
開發者團隊
原文外掛簡介
Enforce Featured Image is an API to enforce certain post types to be published with a featured image with certain dimensions if specified.
Usage
Write an another plugin file, or paste the example below in your theme functions.php file:
if ( class_exists( 'Enforce_Featured_Image' ) ) {
Enforce_Featured_Image::enforce_on_post_type( 'post', array(
'min_width' => 640,
'min_height' => 300,
'force_on_published_posts' => false,
) );
}
Note: You can use Code Snippets plugin to add the code snippets to your site.
Credits
This plugin is based on Force Featured Image plugin by XWP.
Contributing
Developers can contribute to the source code on the Github Repository.
