[WordPress] 外掛分享: CMB Field Type: Sorter

首頁外掛目錄 › CMB Field Type: Sorter
10+
安裝啟用
★★★★★
5/5 分(2 則評價)
3941 天前
最後更新
問題解決
WordPress 3.6.1+ v1.0.0 上架:2015-05-19

內容簡介

這個外掛提供了兩種基於 Sorter script 的 CMB 欄位類型:

使用方法

tb_sorter – 下拉選單,內含類似 Typeahead 的搜尋功能。範例:

$cmb->add_field(array(
'name' => '頁面配置',
'id' => $prefix . 'ingredients',
'desc' => '選擇頁面配置',
'type' => 'tb_sorter',
'options' => array(
'enabled' => array(
'highlights' => '亮點',
'slider' => '滑塊',
'staticpage' => '靜態頁面',
),
'disabled' => array(
'services' => '服務'
)
),
));

輸出結果

get_post_meta(get_the_ID(), '_yourprefix_about_ingredients', true);

重要提示:鍵值對中的 'placebo' => 'placebo' 已不再需要。

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「CMB Field Type: Sorter」→ 直接安裝(推薦)

原文外掛簡介

This plugin gives you two CMB field types based on the Sorter script:
Usage
`tb_sorter` – Select box with with typeahead-style search. Example:

$cmb->add_field(array(
'name' => 'Page Layout',
'id' => $prefix . 'ingredients',
'desc' => 'Select Page Layout',
'type' => 'tb_sorter',
'options' => array(
'enabled' => array(
'highlights' => 'Highlights',
'slider' => 'Slider',
'staticpage' => 'Static Page',
),
'disabled' => array(
'services' => 'Services'
)
),
));

Out put

get_post_meta(get_the_ID(), '_yourprefix_about_ingredients', true);

IMPORTANT: The key pair of ‘placebo’ => ‘placebo’ IS NO LONGER REQUIRED.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon