[WordPress] 外掛分享: CC-IMG-Shortcode

首頁外掛目錄 › CC-IMG-Shortcode
WordPress 外掛 CC-IMG-Shortcode 的封面圖片
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
10+
安裝啟用
尚無評分
1464 天前
最後更新
問題解決
WordPress 4.8.2+ PHP 7.2+ v1.1.0 上架:2017-10-19

內容簡介

這個外掛可以新加入 <img> HTML 標籤的 [img] 短碼代碼。它也可以在使用者按下「加入媒體」按鈕時,透過自動插入格式化的短碼代碼到編輯器內,實現在文章/頁面中新增媒體的功能。
您可以簡單地加入帶有媒體 ID 的 [img] 短碼代碼,如下所示:
[img 123 /]

或者,您可以加入完整格式化的 [img] 短碼代碼:
[img 123 align="center" size="full" caption="Sample text" title="Sample text" desc="Sample text" alt="Sample text" url="http://example.com/" /]

它支援 srcset 和 sizes 參數。
技巧與提示

您可以使用篩選器(filter)自訂要顯示的 img 標籤樣式模板,如下所示:
add_filter( 'Clearcode\IMG_Shortcode\template', function() { return '/themes/clearcode.cc/templates/img.php'; } );

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.0) 或搜尋安裝

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

原文外掛簡介

This plugin adds the [img] shortcode which replaces the html tag. It’s also enables adding new media to post/page via the ‘Add media’ button by automatically inserting the formatted shortcode code to the editor.
You can simply add the [img] shortcode with a media ID to display:
[img 123 /]

or a fully formatted [img] shortcode:
[img 123 align="center" size="full" caption="Sample text" title="Sample text" desc="Sample text" alt="Sample text" url="http://example.com/" /]

It’s supports srcset and sizes parameters.
Tips & Tricks
You can use your own html template file for displaying the img tag by using filter:
add_filter( 'Clearcode\IMG_Shortcode\template', function() { return '/themes/clearcode.cc/templates/img.php'; } );

延伸相關外掛

文章
Filter
Apply Filters
Mastodon