[WordPress] 外掛分享: Enforce Featured Image

首頁外掛目錄 › Enforce Featured Image
全新外掛
安裝啟用
尚無評分
3372 天前
最後更新
問題解決
WordPress 4.4+ v0.1.3 上架:2016-12-22

內容簡介

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 儲存庫 貢獻原始碼。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.1.3) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Enforce Featured Image」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon