[WordPress] 外掛分享: Subtitle

首頁外掛目錄 › Subtitle
100+
安裝啟用
★★★☆☆
3/5 分(2 則評價)
4704 天前
最後更新
問題解決
WordPress 3.5.1+ v0.1 上架:2013-04-30

內容簡介

在文章、頁面和其他文章類型的編輯頁面中,顯示標題後的副標題文字欄位。

GitHub
外掛主頁

在模板中獲取並顯示

使用 get_nskw_subtitle() 進行獲取,nskw_subtitle() 進行顯示。

更改標籤
預設的輸入欄位標籤為 "Subtitle"。有一個 hook 可以進行更改。

add_filter( 'nskw-fat-meta_label', 'nskw_changeLabel' );
function nskw_changeLabel() {
return '新標籤';
}

在特定文章類型中隱藏

預設情況下,除了附件之外,副標題欄位會出現在每個文章類型的編輯頁面中。

要在特定文章類型頁面中隱藏,有一個 hook。

// 在 'attachment'、'page' 和 'newposttype' 的文章類型中隱藏副標題欄位
add_filter( 'nskw-fat_post_type', 'nskw_hide_subtitle' );
function nskw_hide_subtitle() {
return array( 'attachment', 'page', 'newposttype' );
}

外掛標籤

開發者團隊

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

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

原文外掛簡介

Displays subtitle text field after the title in post, page and other post type edit page.

GitHub
Plugin Homepage

Retriving and displaying in templates
Use get_nskw_subtitle() to retrieve and nskw_subtitle() to display.
Change label
By default the label of the input field is "Subtitle". There's a hook for changing it.

add_filter( 'nskw-fat-meta_label', 'nskw_changeLabel' );
function nskw_changeLabel() {
return 'new label';
}

Hide in specific post types
By default, subtitle field appears in every post type edit pages except for attachment.
To hide in particular post type pages, there’s a hook.
// hide subtitle field in posttype 'attachment', 'page'、''newposttype'
add_filter( 'nskw-fat_post_type', 'nskw_hide_subtitle' );
function nskw_hide_subtitle() {
return array( 'attachment', 'page', 'newposttype' );
}

延伸相關外掛

文章
Filter
Apply Filters
Mastodon