WP 后台框架 Ashuwp Framework 选项卡 tab


注意:文章自定义字段和设置页面都支持选项卡样式,但是分类字段由于代码结构限制没法实现。

WP 后台框架 Ashuwp Framework 选项卡 tab

文章自定义字段

1. 自定义面板中的配置变量增加一个 'tab'=>true
2. 利用 'type' => 'open''type' => 'close' 组合来确定选项卡。
3. 'type' => 'open''type' => 'close' 应该成对组合,不能嵌套。
/*****Meta Box********/
$meta_conf = array(
  'title' => 'Meta box example',
  'id'=>'example_box',
  'page'=>array('page','post'),
  'context'=>'normal',
  'priority'=>'low',
  'tab'=>true, //Look here
);
$ashu_2_meta = array();
$ashu_2_meta[] = array(
  'name' => 'Tab1 Begain',
  'id'   => 'tab1_open',
  'type' => 'open' //Look here
);
$ashu_2_meta[] = array(
  'name' => 'Input Example',
  'id'   => 'text_example',
  'desc' => 'A text input example, Default content:"Hello ashuwp."',
  'std'  => 'Hello ashuwp.',
  'type' => 'text'
);
$ashu_2_meta[] = array(
  'name' => 'Tab1 Close',
  'type' => 'close' //Look here
);
$ashu_2_meta[] = array(
  'name' => 'Tab2 Begain',
  'id'   => 'tab2_open',
  'type' => 'open' //Look here
);
$ashu_2_meta[] = array(
  'name' => 'Input Example2',
  'id'   => 'text_example2',
  'desc' => 'A text input example, Default content:"Hello ashuwp."',
  'std'  => 'Hello ashuwp.',
  'type' => 'text'
);
$ashu_2_meta[] = array(
  'name' => 'Texearea Example',
  'id'   => 'textarea_example',
  'desc' => 'A textarea example, Default content:"Default content."',
  'std'  => 'Default content.',
  'type' => 'textarea'
);
$ashu_2_meta[] = array(
  'name' => 'Tab2 Close',
  'type' => 'close' //Look here
);
$tab_box = new ashuwp_postmeta_feild($ashu_2_meta, $meta_conf);

设置页面

/**
*
*Optinos page
*
**/
/**General options**/
$page_info = array(
  'full_name' => 'General Options',
  'optionname'=>'general',
  'child'=>false,
  'filename' => 'generalpage',
  'tab'=>true //Look here
);
$ashu_2_options = array();
$ashu_2_options[] = array(
  'name' => 'Tab1 Begain',
  'id'   => 'tab1_open',
  'type' => 'open' //Look here
);
$ashu_2_options[] = array(
  'name' => 'Input Example',
  'id'   => 'text_example',
  'desc' => 'A text input example, Default content:"Hello ashuwp."',
  'std'  => 'Hello ashuwp.',
  'type' => 'text'
);
$ashu_2_options[] = array(
  'name' => 'Tab1 Close',
  'type' => 'close' //Look here
);
$ashu_2_options[] = array(
  'name' => 'Tab2 Begain',
  'id'   => 'tab2_open',
  'type' => 'open' //Look here
);
$ashu_2_options[] = array(
  'name' => 'Input Example2',
  'id'   => 'text_example2',
  'desc' => 'A text input example, Default content:"Hello ashuwp."',
  'std'  => 'Hello ashuwp.',
  'type' => 'text'
);
$ashu_2_options[] = array(
  'name' => 'Texearea Example',
  'id'   => 'textarea_example',
  'desc' => 'A textarea example, Default content:"Default content."',
  'std'  => 'Default content.',
  'type' => 'textarea'
);
$ashu_2_options[] = array(
  'name' => 'Tab2 Close',
  'type' => 'close' //Look here
);
$option_page = new ashuwp_options_feild($ashu_2_options, $page_info);

<< WP 后台框架 Ashuwp Framework 文本编辑器 tinymce WP 后台框架 Ashuwp Framework 组合输入框 >>