
內容簡介
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
外掛標籤
開發者團隊
原文外掛簡介
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
