Files
wordpress-kratos-yang/inc/theme-options.php
T
laoyang 0799268661 3.2.16: 删三项无用功能、选项重排为 10 组、修移动端提示条偏左
删除
- 微信二维码:配置项 s_wechat / 隐藏上传 s_wechat_url、footer 浮动块、
  默认图注册表条目、CSS 规则、wechat.png
- Font Awesome:选项 g_fontawesome、theme-core 入队、58KB 样式、
  assets/fonts/webfonts 全套字体(2.8MB,CSS 删后零引用)
- 多人模式:选项 multiusers、page-content / page-toolbar 两处分支

选项重排(9 组 → 10 组)
全站配置 / 顶部导航 / 首页配置 / 文章配置 / 站长信息 /
页脚配置 / 哀悼模式 / 收录与统计 / 邮件通知 / 自定义代码
哀悼 5 个字段从「首页配置」独立成「哀悼模式」——它不是首页专属功能。
g_404/g_chrome/g_animate/g_gravatar 等归「全站配置」,s_copyright 归「页脚配置」。

修复
- footer.php 版权行此前无条件硬编码,后台 s_copyright 填了不生效
- 附加日期命中时 yang_mourning_today_name() 返回空串,提示条退化成
  只说「今天是纪念日」而不给名字
- 小屏哀悼提示条 padding 写成 `7px 40px 7px 12px`(右宽左窄给关闭按钮
  让位),内容盒中心 181 vs 视口中心 195,整体偏左 14px。关闭按钮本就
  absolute 不占内部流,改为左右等宽 + 缩小按钮。桌面端同类错误 3.2.14 已修,
  此处漏了同一个断点。

加载顺序
theme-options.php 可能早于 theme-mourning.php / theme-custom-code.php 加载,
新增 yang_opt_* 四个 function_exists 包装,避免裸调用导致后台白屏。

验证:静态断言 62/0 · 后台面板 14/0 · 反向验证 7/7 与 44/0 ·
提示条 4 视口几何 20/0(注入旧 bug 精确复现 -14px)· 线上 3 视口 33/0
2026-10-23 22:56:10 +08:00

673 lines
27 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* 主题选项
*
* ── 分类原则(3.2.15 重排)────────────────────────────────────
* 原来九个头部分类里有几处明显错位:
* · 哀悼功能挂在「首页配置」下面 —— 它影响的是整站(首页、文章页、说明页),
* 跟首页没有关系;
* · 国旗、备案、版权拆在「页脚」但「404 图片」在全站,都是零碎的;
* · 「收录配置」把 robots.txt 一起塞进来,其实那是另一件事。
*
* 现在的顺序按「访客看到的顺序」排:整站基础 → 顶部 → 首页 → 文章 →
* 站长 → 页脚 → 专项功能 → 收录 → 邮件 → 自定义代码。
* 每一项只出现在它真正生效的地方,不再有"在首页配置里改整站行为"这种事。
*
* @author Yongquan Yang <yangyq.net>
* @license MIT License
* @version 2020.09.21
*/
function getrobots()
{
$site_url = parse_url(site_url());
$path = (!empty($site_url['path'])) ? $site_url['path'] : '';
$robots = "User-agent: *\n\n";
$robots .= "Disallow: $path/wp-admin/\n";
$robots .= "Disallow: $path/wp-includes/\n";
$robots .= "Disallow: $path/wp-content/plugins/\n";
$robots .= "Disallow: $path/wp-content/themes/\n";
return $robots;
}
/**
* 图片字段的默认值(后台预填用)。
*
* ── 为什么不直接调 yang_image_default() ──────────────────────
* 本文件由 optionsframework_init() 在 init 钩子上 require,
* 而 yang_image_default() 来自 inc/theme-option-defaults.php。
* 正常时序下后者先加载,但**加载顺序被打乱时**(子主题、外部脚本
* 直接 include 本文件、插件在更早的钩子里触发本函数),
* 直接调用就会 Fatal —— 后台整个白屏,比"少一个预填值"严重得多。
*
* 这里先用 function_exists() 探一下,缺了就返回空串:
* 后台退化成没有预填默认值,但页面能打开、能保存、能干活。
* 降级必须降到"还能用",不能降到"打不开"。
*/
if (!function_exists('yang_options_default_img')) {
function yang_options_default_img($id)
{
return function_exists('yang_image_default')
? yang_image_default($id)
: '';
}
}
/**
* 哀悼相关辅助函数的安全访问
*
* 同样的道理:yang_mourning_presets() / yang_mourning_status_text() /
* yang_mourning_extra_raw() 都在 inc/theme-mourning.php 里,由
* functions.php 按顺序 require。只要有人(子主题、迁移脚本、别的插件)
* 在 theme-mourning.php 之前触发了 kratos_options(),这里就会 Fatal,
* 整个后台白屏,且报错指向本文件,很难联想到是加载顺序问题。
*
* 降级策略:缺函数时按"没有纪念日 / 没有状态说明"降级 ——
* 后台那几个控件会变空,但页面能打开、能保存、能继续用。
*/
if (!function_exists('yang_opt_mourning_presets')) {
function yang_opt_mourning_presets()
{
return function_exists('yang_mourning_presets')
? yang_mourning_presets()
: array();
}
}
if (!function_exists('yang_opt_mourning_status')) {
function yang_opt_mourning_status()
{
return function_exists('yang_mourning_status_text')
? yang_mourning_status_text()
: '';
}
}
if (!function_exists('yang_opt_mourning_extra_raw')) {
function yang_opt_mourning_extra_raw()
{
return function_exists('yang_mourning_extra_raw')
? yang_mourning_extra_raw()
: '';
}
}
/**
* 自定义 CSS 的默认值(来自 inc/theme-custom-code.php)
*
* 同样是加载顺序问题:这个函数在 theme-custom-code.php 里,
* 而 kratos_options() 可能被更早触发。缺了就返回空串,
* 后台的「自定义 CSS」框是空的,但能打开、能填、能保存。
*/
if (!function_exists('yang_opt_default_custom_css')) {
function yang_opt_default_custom_css()
{
return function_exists('yang_default_custom_css')
? yang_default_custom_css()
: '';
}
}
function kratos_options()
{
$sitename = get_bloginfo('name');
$imagepath = ASSET_PATH . '/assets/img/options/';
$seorobots = '<a href="' . home_url() . '/robots.txt" target="_blank">robots.txt</a>';
$seoreading = '<a href="' . admin_url('options-reading.php') . '" target="_blank">' . __('设置-阅读-对搜索引擎的可见性', 'kratos') . '</a>';
$top_array = array(
'banner' => __( '图片导航', 'kratos' ),
'color' => __( '颜色导航', 'kratos' ),
);
$options = array();
/* ══════════════════════════════════════════════════════════
* 一、全站配置 —— 影响每一个页面的东西
* ══════════════════════════════════════════════════════════ */
$options[] = array(
'name' => __('全站配置', 'kratos'),
'type' => 'heading',
);
$options[] = array(
'name' => __('图片 Logo', 'kratos'),
'desc' => __('不选择图片则显示文字标题', 'kratos'),
'id' => 'g_logo',
'type' => 'upload',
/* 有意不设 std:这里空着时显示站点名称文字,比塞一张通用占位
logo 好看。其它图片字段见 inc/theme-option-defaults.php。 */
);
$options[] = array(
'name' => __('Favicon 图片', 'kratos'),
'desc' => __('浏览器收藏夹和地址栏中显示的图标。<b>留空则自动使用主题自带的默认图标</b>,不会出现空白。', 'kratos'),
'id' => 'g_icon',
/* 有意不写 std。
*
* std 里存的是**绝对 URL**,一旦用户保存表单就会被写进数据库。
* 数据库里躺着一个写死的主题目录地址是隐患:主题目录改名、
* 换 CDN、或站点迁移域名之后,那条记录就指向不存在的文件,
* 页面上是破图,而用户在后台看到的仍是"已设置",很难自己发现。
*
* 所以默认值一律由运行时提供(yang_option_image()),库里保持空。
* 这样默认图地址永远由当前请求现算,改目录也不用改数据。
*/
'type' => 'upload',
);
$options[] = array(
'name' => __('背景颜色', 'kratos'),
'desc' => __('全站页面的背景颜色,需填写十六进制颜色码', 'kratos'),
'id' => 'g_background',
'std' => '#f5f5f5',
'type' => 'color',
);
$options[] = array(
'name' => __('Chrome 导航栏颜色', 'kratos'),
'desc' => __('Chrome 移动端浏览器地址栏的颜色', 'kratos'),
'id' => 'g_chrome',
'std' => '#282a2c',
'type' => 'color',
);
$options[] = array(
'name' => __('404 页面图片', 'kratos'),
'desc' => __('访客打开不存在的地址时显示的配图', 'kratos'),
'id' => 'g_404',
'std' => yang_options_default_img('g_404'),
'type' => 'upload',
);
$options[] = array(
'name' => __('前台管理员导航', 'kratos'),
'desc' => __('登录管理员后,页面顶部显示 WordPress 管理工具条', 'kratos'),
'std' => '1',
'id' => 'g_adminbar',
'type' => 'checkbox',
);
$options[] = array(
'name' => __('CSS 动画库', 'kratos'),
'desc' => __('开启 animate.css 效果。会增加一个约 60KB 的样式文件,不需要就别开。', 'kratos'),
'std' => '0',
'id' => 'g_animate',
'type' => 'checkbox',
);
$options[] = array(
'name' => __('Gravatar 加速', 'kratos'),
'desc' => __('把评论头像的请求转发到国内可访问的镜像,改善加载速度', 'kratos'),
'std' => '0',
'id' => 'g_gravatar',
'type' => 'checkbox',
);
$options[] = array(
'name' => __('禁止生成缩略图', 'kratos'),
'desc' => __('上传图片时不再额外生成多种尺寸的副本,节省磁盘空间', 'kratos'),
'id' => 'g_removeimgsize',
'std' => '0',
'type' => 'checkbox',
);
$options[] = array(
'name' => __('Gutenberg 编辑器', 'kratos'),
'desc' => __('开启 WordPress 区块编辑器。关闭则使用经典编辑器。', 'kratos'),
'std' => '0',
'id' => 'g_gutenberg',
'type' => 'checkbox',
);
/* ══════════════════════════════════════════════════════════
* 二、顶部导航 —— 页头那一条
* ══════════════════════════════════════════════════════════ */
$options[] = array(
'name' => __('顶部导航', 'kratos'),
'type' => 'heading',
);
$options[] = array(
'name' => __( '顶部样式', 'kratos' ),
'desc' => __('请选择顶部样式(图片导航或颜色导航)', 'kratos'),
'id' => 'top_select',
'std' => 'banner',
'type' => 'select',
'options' => $top_array
);
$options[] = array(
'name' => __('图片导航背景', 'kratos'),
'desc' => __('顶部样式选「图片导航」时使用。<b>留空则自动使用主题自带的默认图片</b>。', 'kratos'),
'id' => 'top_img',
'std' => yang_options_default_img('top_img'),
'class' => 'hidden',
'type' => 'upload',
);
$options[] = array(
'name' => __('颜色导航背景', 'kratos'),
'desc' => __('顶部样式选「颜色导航」时使用', 'kratos'),
'id' => 'top_color',
'std' => '#24292e',
'class' => 'hidden',
'type' => 'color',
);
$options[] = array(
'name' => __('副标题', 'kratos'),
'desc' => __('显示在站点标题旁边的一句短话', 'kratos'),
'id' => 'top_title',
'std' => 'Kratos',
'class' => 'hidden',
'type' => 'text',
);
$options[] = array(
'name' => __('标题描述', 'kratos'),
'std' => __('一款专注于用户阅读体验的响应式博客主题', 'kratos'),
'id' => 'top_describe',
'class' => 'hidden',
'type' => 'text',
);
/* ══════════════════════════════════════════════════════════
* 三、首页配置 —— 只管首页列表长什么样
* ══════════════════════════════════════════════════════════ */
$options[] = array(
'name' => __('首页配置', 'kratos'),
'type' => 'heading',
);
$options[] = array(
'name' => __('特色图片', 'kratos'),
'desc' => __('在首页文章列表的每篇标题上方显示一张配图', 'kratos'),
'std' => '1',
'id' => 'g_thumbnail',
'type' => 'checkbox',
);
$options[] = array(
'name' => __('默认特色图', 'kratos'),
'desc' => __('文章既没有正文图片、也没有设置特色图时,用这张顶上。<b>留空则自动使用主题自带的默认图片</b>。', 'kratos'),
'id' => 'g_postthumbnail',
'class' => 'hidden',
'std' => yang_options_default_img('g_postthumbnail'),
'type' => 'upload',
);
$options[] = array(
'name' => __('无内容图片', 'kratos'),
'desc' => __('搜索不到结果、或分类下还没有文章时显示的插画。<b>留空则自动使用主题自带的默认图片</b>。', 'kratos'),
'id' => 'g_nothing',
'std' => yang_options_default_img('g_nothing'),
'type' => 'upload',
);
/* ══════════════════════════════════════════════════════════
* 四、文章配置 —— 打开单篇文章才看得到的东西
* ══════════════════════════════════════════════════════════ */
$options[] = array(
'name' => __('文章配置', 'kratos'),
'type' => 'heading',
);
$options[] = array(
'name' => __('页面布局', 'kratos'),
'desc' => __('文章页面是否显示侧边栏。仅在文章详情页生效。', 'kratos'),
'id' => "g_article_widgets",
'std' => "two_side",
'type' => "images",
'options' => array(
'one_side' => $imagepath . 'col-12.png',
'two_side' => $imagepath . 'col-8.png')
);
$options[] = array(
'name' => __('文章打赏', 'kratos'),
'desc' => __('在文章底部显示打赏按钮,点开是收款二维码', 'kratos'),
'id' => 'g_donate',
'type' => 'checkbox',
);
$options[] = array(
'name' => __('支付宝收款码', 'kratos'),
'desc' => __('<b>留空则自动使用主题自带的默认图片</b>。', 'kratos'),
'id' => 'g_donate_alipay',
'std' => yang_options_default_img('g_donate_alipay'),
'type' => 'upload',
'class' => 'hidden',
);
$options[] = array(
'name' => __('微信收款码', 'kratos'),
'desc' => __('<b>留空则自动使用主题自带的默认图片</b>。', 'kratos'),
'id' => 'g_donate_wechat',
'std' => yang_options_default_img('g_donate_wechat'),
'type' => 'upload',
'class' => 'hidden',
);
/* ══════════════════════════════════════════════════════════
* 五、站长信息 —— 文章页页脚那张名片
* ══════════════════════════════════════════════════════════ */
$options[] = array(
'name' => __('站长信息', 'kratos'),
'type' => 'heading',
);
$options[] = array(
'name' => __('个人头像', 'kratos'),
'desc' => __('显示在文章底部作者名片里。<b>留空则自动使用主题自带的默认头像</b>。', 'kratos'),
'id' => 'a_gravatar',
'std' => yang_options_default_img('a_gravatar'),
'type' => 'upload',
);
$options[] = array(
'name' => __('个人昵称', 'kratos'),
'id' => 'a_nickname',
'std' => 'Kratos',
'type' => 'text',
);
$options[] = array(
'name' => __('个人简介', 'kratos'),
'std' => __('保持饥渴的专注,追求最佳的品质', 'kratos'),
'id' => 'a_about',
'type' => 'textarea',
);
/* ══════════════════════════════════════════════════════════
* 六、页脚配置 —— 页面最底下那几行
* ══════════════════════════════════════════════════════════ */
$options[] = array(
'name' => __('页脚配置', 'kratos'),
'type' => 'heading',
);
$options[] = array(
'name' => __('版权信息', 'kratos'),
'desc' => __('页脚显示的那行版权声明。<b>留空则自动用「COPYRIGHT © 当前年份 站点名称 版权所有」</b>。', 'kratos'),
'id' => 's_copyright',
/* 有意不写 std:std 里写死的年份过一年就变成旧年份,
而且一旦保存就永久留在库里。改由 footer.php 每次现算。 */
'type' => 'textarea',
);
$options[] = array(
'name' => __('是否显示国旗', 'kratos'),
'desc' => __('在页脚显示一面国旗', 'kratos'),
'std' => '0',
'id' => 'g_flag',
'type' => 'checkbox',
);
$options[] = array(
'name' => __('国旗图片', 'kratos'),
'desc' => __('<b>留空则自动使用主题自带的默认国旗</b>。', 'kratos'),
'id' => 'g_flag_url',
/* 不写 std —— 理由同 g_icon:默认值由运行时给,库里不存绝对地址。 */
'type' => 'upload',
);
$options[] = array(
'name' => __('工信部备案信息', 'kratos'),
'id' => 's_icp',
'placeholder' => __('例如:京ICP证xxxxxx号', 'kratos'),
'type' => 'text',
);
$options[] = array(
'name' => __('公安网备案信息', 'kratos'),
'id' => 's_gov',
'placeholder' => __('例如:京公网安备 xxxxxxxxxxxx号', 'kratos'),
'type' => 'text',
);
$options[] = array(
'name' => __('公安网备案链接', 'kratos'),
'id' => 's_gov_link',
'placeholder' => __('例如:http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=xxxxx', 'kratos'),
'type' => 'text',
);
/* ══════════════════════════════════════════════════════════
* 七、哀悼模式 —— 整站级功能,与首页无关
*
* 这一组原来错放在「首页配置」下面。它影响的是整站配色
* (首页、文章页、说明页都变黑白),放首页下面会让人以为
* 只改首页,而且想找它的人第一反应不会去点「首页配置」。
* 单独成组,名字直说它是什么。
* ══════════════════════════════════════════════════════════ */
$options[] = array(
'name' => __('哀悼模式', 'kratos'),
'type' => 'heading',
);
$options[] = array(
'name' => __('手动常开', 'kratos'),
'desc' => __('勾上就一直黑白,与日期无关。这是老的开关,日常建议用下面的「按纪念日自动哀悼」。', 'kratos'),
'id' => 'g_rip',
'type' => 'checkbox',
);
$options[] = array(
'name' => __('按纪念日自动哀悼', 'kratos'),
'desc' => __('勾选后,只有在下表勾选的那些日期才会自动黑白,其余日子正常显示。日期按站点时区判断,只比对月和日,每年循环。', 'kratos'),
'id' => 'g_rip_auto',
'type' => 'checkbox',
);
// 把内置清单转成 multicheck 需要的格式
$rip_legal = array();
$rip_custom = array();
foreach (yang_opt_mourning_presets() as $md => $info) {
$entry = array(
'name' => $md . ' ' . $info['name'],
'note' => $info['note'],
);
if (isset($info['group']) && $info['group'] === 'legal') {
$rip_legal[$md] = $entry;
} else {
$rip_custom[$md] = $entry;
}
}
$rip_default = array();
foreach (yang_opt_mourning_presets() as $md => $info) {
$rip_default[$md] = !empty($info['default']) ? 1 : 0;
}
$options[] = array(
'name' => __('纪念日清单', 'kratos'),
'desc' => __('勾选需要自动黑白的日期。<b>默认一个都不勾</b>,请按自己的意愿挑选。前三个是法定纪念日,后面几个是民间通行做法。日期按站点时区判断,只比对月和日,每年循环。', 'kratos'),
'id' => 'g_rip_days',
'std' => $rip_default,
'type' => 'multicheck',
'options' => array_merge($rip_legal, $rip_custom),
);
$options[] = array(
'name' => __('附加日期', 'kratos'),
'desc' => sprintf(
__('清单里没有的日期填这里。<br><b>%1$s</b> 表示每年循环(如 05-12);<b>%2$s</b> 表示只在当年生效(如 2020-04-04,用于历次全国哀悼日这类一次性事件)。<br>多个日期用空格或逗号分隔。当前填的是 <b>%3$s</b>。', 'kratos'),
'MM-DD',
'YYYY-MM-DD',
esc_html(yang_opt_mourning_extra_raw() === '' ? __('(空)', 'kratos') : yang_opt_mourning_extra_raw())
),
'id' => 'g_rip_extra',
'type' => 'text',
);
$options[] = array(
'name' => __('说明页路径', 'kratos'),
'desc' => sprintf(
/* 注意:desc 会过 wp_kses($allowedtags),那是 WordPress 的默认白名单,
只放行 a/abbr/b/br/em/i/strong 等,**不放行 <code>** ——
写 <code> 会被静默剥掉,页面上只剩裸文字。所以这里用 <b> 强调。 */
__('变黑白时,页面顶部会出现一条提示,点进去是一个说明页面(彩色),讲清楚为什么变黑白、哪几天会变。<br>这里可以改那个页面的路径。留空默认 <b>memory</b>,即 %s<br><b>注意:</b>不要和已有文章或页面的路径重名。', 'kratos'),
esc_url(home_url('/memory/'))
),
'id' => 'g_rip_page_slug',
'std' => 'memory',
'type' => 'text',
);
$options[] = array(
'desc' => yang_opt_mourning_status(),
'type' => 'info',
);
/* ══════════════════════════════════════════════════════════
* 八、收录与统计 —— 给搜索引擎看的
* ══════════════════════════════════════════════════════════ */
$options[] = array(
'name' => __('收录与统计', 'kratos'),
'type' => 'heading',
);
$options[] = array(
'name' => __('分享图片', 'kratos'),
'desc' => __('搜索引擎或者社交工具分享首页时抓取的图片。<b>留空则自动使用主题自带的默认图片</b>。', 'kratos'),
'id' => 'seo_shareimg',
'std' => yang_options_default_img('seo_shareimg'),
'type' => 'upload',
);
$options[] = array(
'name' => __('关键词', 'kratos'),
'desc' => __('每个关键词之间需要用「英文逗号」分割', 'kratos'),
'id' => 'seo_keywords',
'type' => 'text',
);
$options[] = array(
'name' => __('站点描述', 'kratos'),
'id' => 'seo_description',
'type' => 'textarea',
);
$options[] = array(
'name' => __('统计代码', 'kratos'),
'desc' => __('填在页脚的统计脚本(如站点访问量统计)。注意:输入 HTML/JS 代码时请注意辨别代码安全!', 'kratos'),
'id' => 'seo_statistical',
'type' => 'textarea',
);
$options[] = array(
'name' => __('robots.txt 内容', 'kratos'),
'desc' => __('- 需要 ', 'kratos') . $seoreading . __(' 是开启的状态,下面的配置才会生效', 'kratos'),
'type' => 'info',
);
$options[] = array(
'desc' => __('- 如果网站根目录下已经有 robots.txt 文件,下面的配置不会生效', 'kratos'),
'type' => 'info',
);
$options[] = array(
'desc' => __('- 点击 ', 'kratos') . $seorobots . __(' 查看配置是否生效,如果网站开启了 CDN,可能需要刷新缓存才会生效', 'kratos'),
'type' => 'info',
);
$options[] = array(
'id' => 'seo_robots',
'std' => getrobots(),
'type' => 'textarea',
);
/* ══════════════════════════════════════════════════════════
* 九、邮件通知 —— SMTP 与评论提醒
* ══════════════════════════════════════════════════════════ */
$options[] = array(
'name' => __('邮件通知', 'kratos'),
'type' => 'heading',
);
$options[] = array(
'name' => __('SMTP 服务', 'kratos'),
'desc' => __('用第三方邮箱发信。不开启时走服务器本地发信,很多主机上会被判定为垃圾邮件。', 'kratos'),
'id' => 'm_smtp',
'type' => 'checkbox',
);
$options[] = array(
'name' => __('邮件服务器', 'kratos'),
'desc' => __('填写发件服务器地址', 'kratos'),
'id' => 'm_host',
'class' => 'hidden',
'type' => 'text',
);
$options[] = array(
'name' => __('服务器端口', 'kratos'),
'desc' => __('填写发件服务器端口', 'kratos'),
'id' => 'm_port',
'class' => 'hidden',
'type' => 'text',
);
$options[] = array(
'name' => __('授权方式', 'kratos'),
'desc' => __('填写登录鉴权的方式,ssl 或 tls', 'kratos'),
'id' => 'm_sec',
'class' => 'hidden',
'type' => 'text',
);
$options[] = array(
'name' => __('邮箱帐号', 'kratos'),
'desc' => __('填写邮箱账号', 'kratos'),
'id' => 'm_username',
'class' => 'hidden',
'type' => 'text',
);
$options[] = array(
'name' => __('邮箱密码', 'kratos'),
'desc' => __('填写邮箱密码或授权码', 'kratos'),
'id' => 'm_passwd',
'class' => 'hidden',
'type' => 'password',
);
$options[] = array(
'id' => 'm_sendmail',
'class' => 'hidden',
'type' => 'sendmail',
);
/* ══════════════════════════════════════════════════════════
* 十、自定义代码 —— 兜底用,放最后
* ══════════════════════════════════════════════════════════ */
$options[] = array(
'name' => __('自定义代码', 'kratos'),
'type' => 'heading',
);
$options[] = array(
'name' => __('自定义 CSS', 'kratos'),
'desc' => __('附加样式,在所有主题样式之后加载。保存后立即生效,随主题升级保留。', 'kratos'),
'id' => 'g_custom_css',
'std' => yang_opt_default_custom_css(),
'type' => 'code',
'settings' => array('rows' => 14),
);
$options[] = array(
'name' => __('自定义 JS', 'kratos'),
'desc' => __('附加脚本,在页面底部加载,不需要写 &lt;script&gt; 标签。', 'kratos'),
'id' => 'g_custom_js',
'std' => '',
'type' => 'code',
'settings' => array('rows' => 14),
);
return $options;
}