'
',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
function getOptions() {
// 在数据库中获取选项组
$options = get_option('classic_options');
// 如果数据库中不存在该选项组, 设定这些选项的默认值, 并将它们插入数据库
if (!is_array($options)) {
$options['notice'] = false;
$options['notice_content'] = '';
update_option('classic_options', $options);
}
return $options;
}
function init() {
if(isset($_POST['classic_save'])) {
$options = getOptions();
if ($_POST['notice']) {
$options['notice'] = (bool)true;
} else {
$options['notice'] = (bool)false;
}
$options['notice_content'] = stripslashes($_POST['notice_content']);
update_option('classic_options', $options);
}
else
getOptions();
add_theme_page("标签页", __('Theme Options'), 'edit_themes', basename(__FILE__), 'display');
}
function display() {
$options = getOptions();
?>