內容簡介
這個外掛提供了兩種基於 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' 已不再需要。
外掛標籤
開發者團隊
原文外掛簡介
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.
