[WordPress] 外掛分享: WP Site Options

首頁外掛目錄 › WP Site Options
WordPress 外掛 WP Site Options 的封面圖片
20+
安裝啟用
尚無評分
324 天前
最後更新
問題解決
WordPress 4.0+ v1.2.1 上架:2017-02-06

內容簡介

Site Options 是一個簡單免費的外掛,可在預設頁「設定」->「閱讀」上增加您的自訂網站選項。
只需在您的功能檔案中定義所需的設定。詳細的使用說明。

添加自訂選項

add_action( 'init', 'custom__site_options', 10 );
function custom__site_options(){
global $wpto;
if ( $wpto )
$wpto->fields = array (
'section_one' => array( array( 'Header - First Settings', 'description will come' ), array(
'f_number' => array( 'number', 'A Number' ),
'f_text' => array( 'text', 'Simple text' ),
)),
'section_two' => array( array( 'Header - Additional settings', 'description will soon' ), array(
'f_gallery' => array( 'gallery', 'Awesome gallery' ),
'f_chbox' => array( 'checkbox', 'Are u checked?' ),
)),
);
}

在佈景主題檔案中取得

global $wpto;
echo $wpto->getOption( 'section_one::f_text' ) ;

支援欄位類型

text
textarea
wysiwyg
checkbox
number
select
email
image
gallery
colorpicker

外掛標籤

開發者團隊

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

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

原文外掛簡介

The Site Options plugin is a simple and free product for adding your custom site options on default page Settings -> Reading.
Just define needed settings in your functions file. More instructions.
Adding your custom options

add_action( 'init', 'custom__site_options', 10 );
function custom__site_options(){
global $wpto;
if ( $wpto )
$wpto->fields = array (
'section_one' => array( array( 'Header - First Settings', 'description will come' ), array(
'f_number' => array( 'number', 'A Number' ),
'f_text' => array( 'text', 'Simple text' ),
)),
'section_two' => array( array( 'Header - Additional settings', 'description will soon' ), array(
'f_gallery' => array( 'gallery', 'Awesome gallery' ),
'f_chbox' => array( 'checkbox', 'Are u checked?' ),
)),
);
}

Access in the theme files

global $wpto;
echo $wpto->getOption( 'section_one::f_text' ) ;

Field types support

text
textarea
wysiwyg
checkbox
number
select
email
image
gallery
colorpicker

延伸相關外掛

文章
Filter
Apply Filters
Mastodon