File: /www/wwwroot/www.sceysls.com/wp-content/themes/Zing-Pro/admin/dahuzi-framework/config/options.php
<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
//
// Set a unique slug-like ID
//
$prefix = 'xintheme_optimize';
//
// Create options
//
DAHUZI::createOptions( $prefix, array(
'menu_title' => '网站设置',
'menu_slug' => 'xintheme-optimize',
'menu_icon' => 'dashicons-wordpress',
'menu_type' => 'submenu',
'menu_parent'=> 'xintheme-page'
) );
//
// 其他设置
//
DAHUZI::createSection( $prefix, array(
'title' => '其他设置',
'fields' => array(
array(
'id' => 'default_timthumb',
'type' => 'media',
'title' => '文章默认缩略图',
'add_title' => '上传图片',
'desc' => '当没有设置文章特色图片且文章内没有图片的时候显示默认缩略图。(<a target="_blank" href="https://www.xintheme.com/theme-docs/149675.html">查看详细介绍</a>)',
),
array(
'id' => 'dahuzi_thumbnail_link',
'type' => 'checkbox',
'title' => '禁用缩略图PHP剪裁',
'label' => '输出图片直链,不使用PHP剪裁图片。(<a target="_blank" href="#">查看详细介绍</a>)',
'default' => false,
),
array(
'id' => 'remove_admin_dahuzi_contact',
'type' => 'checkbox',
'title' => '隐藏「在线留言」菜单',
'label' => '开启后将会隐藏「在线留言」菜单,但并不影响使用在线留言模块和功能。(<a target="_blank" href="#">查看详细介绍</a>)',
'default' => false,
),
array(
'id' => 'remove_menu_xintheme-license',
'type' => 'checkbox',
'title' => '隐藏「主题授权」菜单',
'label' => '开启后将会隐藏「主题授权」菜单,但你仍然可以通过页面链接进行访问。(<a target="_blank" href="#">查看详细介绍</a>)',
'default' => false,
),
array(
'id' => 'remove_menu_xintheme-optimize',
'type' => 'checkbox',
'title' => '隐藏「网站优化」菜单',
'label' => '开启后将会隐藏「网站优化」菜单,但你仍然可以通过页面链接进行访问。(<a target="_blank" href="#">查看详细介绍</a>)',
'default' => false,
),
array(
'id' => 'dahuzi_404',
'type' => 'radio',
'inline' => true,
'title' => '404 页面',
'options' => array(
'default' => '默认404页面',
'tencent' => '腾讯公益404页面',
),
'default' => 'default',
'desc' => '提供两种不同的404错误页面,可根据个人喜好进行选择。(<a target="_blank" href="#">查看详细介绍</a>)',
),
)
) );
//
// SEO优化
//
DAHUZI::createSection( $prefix, array(
'id' => 'seo',
'title' => 'SEO优化',
//'icon' => 'fa fa-tint',
) );
//
// SEO优化:SEO设置
//
DAHUZI::createSection( $prefix, array(
'parent' => 'seo',
'title' => '网站SEO设置',
'fields' => array(
array(
'type' => 'subheading',
'content' => '可自定义首页、文章页、页面、分类页面的标题、关键词和描述。<a href="https://www.xintheme.com/theme-docs/107113.html" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'dahuzi_seo_switch',
'type' => 'switcher',
'title' => '主题SEO设置',
),
array(
'id' => 'connector',
'type' => 'text',
'title' => '标题分隔符',
'default'=> '-',
'desc' => '一般设置为 - 或 _ 不要留空格',
'attributes' => array('style'=> 'width: 10%;'),
'dependency'=> array( 'dahuzi_seo_switch', '==', true ),
),
array(
'id' => 'hometitle',
'type' => 'text',
'title' => '首页标题',
'desc' => '自定义首页标题,留空则自动调用「后台-设置-常规」中的“站点标题+副标题”的内容',
'attributes' => array('style'=> 'width: 100%;'),
'dependency'=> array( 'dahuzi_seo_switch', '==', true ),
),
array(
'id' => 'home_description',
'type' => 'textarea',
'title' => '首页描述',
'desc' => '一段简单的描述文字',
'attributes' => array('style'=> 'width: 100%;'),
'dependency'=> array( 'dahuzi_seo_switch', '==', true ),
),
array(
'id' => 'home_keywords',
'type' => 'textarea',
'title' => '首页关键词',
'desc' => '多个关键词之间用英文逗号隔开',
'attributes' => array('style'=> 'width: 100%;'),
'dependency'=> array( 'dahuzi_seo_switch', '==', true ),
),
)
) );
//
// SEO优化:网站URL优化
//
DAHUZI::createSection( $prefix, array(
'parent' => 'seo',
'title' => '网站URL优化',
'fields' => array(
array(
'id' => 'no_category',
'type' => 'switcher',
'title' => '',
'label' => '去除固定连接中的「category」标志。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'dahuzi_tag_rewrite',
'type' => 'switcher',
'title' => '',
'label' => 'WordPress标签链接以id方式显示。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'no_zifenlei',
'type' => 'switcher',
'title' => '',
'label' => '去除固定链接中的子分类,去掉前:www.xxx.com/fenlei/zifenlei/123.html,去掉后:www.xxx.com/fenlei/123.html。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'dahuzi_links_nofollow',
'type' => 'switcher',
'title' => '',
'label' => '给「链接」增加Nofollow属性选项。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'html_page_permalink',
'type' => 'switcher',
'title' => '',
'label' => '页面链接添加.html后缀。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'dahuzi_trailingslashit',
'type' => 'switcher',
'title' => '',
'label' => '给分类目录链接末尾添加 / 斜杠。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'xintheme_post_nofollow',
'type' => 'switcher',
'title' => '',
'label' => '文章外链自动添加nofollow标签。<a href="#" target="_blank">查看详细介绍</a>',
),
)
) );
// SEO优化:关键词自动链接
DAHUZI::createSection( $prefix, array(
'parent' => 'seo',
'title' => '关键词自动链接',
'fields' => array(
array(
'type' => 'subheading',
'content' => '自动为关键词添加上网站链接。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'auto_tag_link',
'type' => 'switcher',
'title' => '标签内链',
'desc' => '为文章内的标签自动添加标签页面链接,每个标签仅添加一个超链接',
),
array(
'id' => 'xintheme_auto_key_url',
'type' => 'switcher',
'title' => '自定义关键词链接',
'desc' => '如果文章中出现了你在下面添加的词,将自动给这个词加上你指定的链接地址',
),
array(
'id' => 'xintheme_auto_keyword',
'type' => 'group',
'title' => '添加关键词',
'button_title' => '添加关键词',
'accordion_title' => '添加关键词',
'fields' => array(
array(
'id' => 'auto_keyword_key',
'type' => 'text',
'title' => '关键词',
),
array(
'id' => 'auto_keyword_link',
'type' => 'text',
'title' => '链接地址',
),
array(
'id' => 'auto_keyword_title',
'type' => 'text',
'title' => '说明文本',
'desc' => '显示在a标签的title属性里面',
),
),
'dependency'=> array( 'xintheme_auto_key_url', '==', true ),
),
)
) );
//
// SEO优化:主动推送
//
DAHUZI::createSection( $prefix, array(
'parent' => 'seo',
'title' => '百度-普通收录',
'fields' => array(
array(
'type' => 'subheading',
'content' => '百度站长平台推送接口。<a href="#" target="_blank">查看详细介绍</a>',
),
//普通收录
array(
'id' => 'XinTheme_Baidu_Submit',
'type' => 'switcher',
'title' => '',
'label' => '百度站长平台-普通收录(API提交)',
),
array(
'id' => 'Baidu_Submit_url',
'type' => 'text',
'title' => '网站域名',
'after' => '<p class="cs-text-muted">记得填写“http://”或者“https://”</p>',
'attributes' => array('style'=> 'width: 100%;'),
'dependency' => array( 'XinTheme_Baidu_Submit', '==', true ),
),
array(
'id' => 'Baidu_Submit_token',
'type' => 'text',
'title' => '准入密钥(token)',
'attributes' => array('style'=> 'width: 100%;'),
'dependency' => array( 'XinTheme_Baidu_Submit', '==', true ),
),
)
) );
//
// SEO优化:百度移动专区
//
DAHUZI::createSection( $prefix, array(
'parent' => 'seo',
'title' => '百度-快速收录',
'fields' => array(
array(
'type' => 'subheading',
'content' => '百度站长平台推送接口。<a href="#" target="_blank">查看详细介绍</a>',
),
//快速收录
array(
'id' => 'xiongzhanghao',
'type' => 'switcher',
'title' => '',
'label' => '百度站长平台-快速收录(API提交)',
),
array(
'id' => 'xzh_appid',
'type' => 'text',
'title' => '网站域名',
'after' => '<p class="cs-text-muted">记得填写“http://”或者“https://”</p>',
'attributes' => array('style'=> 'width: 100%;'),
'dependency' => array( 'xiongzhanghao', '==', true ),
),
array(
'id' => 'xzh_post_token',
'type' => 'text',
'title' => '准入密钥(token)',
'attributes' => array('style'=> 'width: 100%;'),
'dependency' => array( 'xiongzhanghao', '==', true ),
),
)
) );
//
// 在线留言
//
DAHUZI::createSection( $prefix, array(
'title' => '在线留言',
'fields' => array(
array(
'type' => 'subheading',
'content' => '老用户注意一下,使用此功能前,请重新启用一下主题,就是先切换到其他任何一个主题,然后在启用Zing-Pro主题就可以了,新用户可以无视。',
),
array(
'id' => 'contact_timthumb',
'type' => 'media',
'title' => '特色图片',
'add_title' => '上传图片',
'desc' => '建议尺寸:560×395 px',
),
array(
'id' => 'mail_contact',
'type' => 'text',
'title' => '通知邮箱',
'desc' => '当有访客提交留言信息后,通过邮件发送到这个指定邮箱账号',
),
array(
'id' => 'post_contact',
'type' => 'switcher',
'title' => '文章内容底部,显示留言表单',
),
)
) );
/** --------------------------------------------------------------------------------- *
* WP优化
* --------------------------------------------------------------------------------- */
DAHUZI::createSection( $prefix, array(
'id' => 'wp_optimization',
'title' => 'WP优化',
//'icon' => 'fa fa-tint',
) );
//
// WP优化:后台优化
//
DAHUZI::createSection( $prefix, array(
'parent' => 'wp_optimization',
'title' => '后台优化',
'fields' => array(
array(
'id' => 'dahuzi_admin_column_img',
'type' => 'switcher',
'title' => '',
'label' => '后台「文章列表中」表显示文章缩略图。<a href="#" target="_blank">查看详细介绍</a>',
//'default' => true,
),
array(
'id' => 'xintheme_moveposttotrash',
'type' => 'switcher',
'title' => '',
'label' => '后台Ajax删除文章。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'xintheme_article',
'type' => 'switcher',
'title' => '',
'label' => '登录后台后默认跳转到文章列表。<a href="#" target="_blank">查看详细介绍</a>',
),
)
) );
//
// WP优化:加速优化
//
DAHUZI::createSection( $prefix, array(
'parent' => 'wp_optimization',
'title' => '加速优化',
'fields' => array(
array(
'id' => 'dahuzi_instantpage',
'type' => 'switcher',
'title' => '',
'label' => '瞬间预加载(Instant Page)。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'xintheme_avatar',
'type' => 'switcher',
'title' => '',
'label' => '使用avatar头像加速,加快加载速度。<a href="#" target="_blank">查看详细介绍</a>',
),
)
) );
//
// WP优化:功能屏蔽
//
DAHUZI::createSection( $prefix, array(
'parent' => 'wp_optimization',
'title' => '功能屏蔽',
'fields' => array(
array(
'id' => 'dahuzi_remove_comment',
'type' => 'switcher',
'title' => '',
'label' => '彻底移除后台「评论」(对企业站来说,评论几乎没用,可根据需求决定是否移除)。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'dahuzi_remove_dashboard',
'type' => 'switcher',
'title' => '',
'label' => '移除后台「仪表盘」菜单。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'dahuzi_remove_tools',
'type' => 'switcher',
'title' => '',
'label' => '移除后台「工具」菜单。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'dahuzi_new_admin_email',
'type' => 'switcher',
'title' => '',
'label' => '移除修改网站管理员邮箱时的邮件验证步骤。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'xintheme_no_gutenberg',
'type' => 'switcher',
'title' => '',
'label' => '禁用古腾堡编辑器。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'no_admin_bar',
'type' => 'switcher',
'title' => '',
'label' => '去除wordpress前台顶部工具条。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'xintheme_privacy',
'type' => 'switcher',
'title' => '',
'label' => '彻底删除后台隐私相关设置。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'xintheme_pingback',
'type' => 'switcher',
'title' => '',
'label' => '关闭 XML-RPC 和 pingback 端口。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'xintheme_wp_head',
'type' => 'switcher',
'title' => '',
'label' => '移除前端header中多余的代码。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'xintheme_wp_head_json',
'type' => 'switcher',
'title' => '',
'label' => '移除前端header中的wp-json代码。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'xintheme_feed',
'type' => 'switcher',
'title' => '',
'label' => '禁止FEED,防采集。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'xintheme_option_thumbnail',
'type' => 'switcher',
'title' => '',
'label' => '彻底关闭WordPress生成默认尺寸的缩略图。<a href="#" target="_blank">查看详细介绍</a>',
),
)
) );
//
// WP优化:登录界面美化
//
DAHUZI::createSection( $prefix, array(
'parent' => 'wp_optimization',
'title' => '登录界面美化',
'fields' => array(
array(
'type' => 'subheading',
'content' => 'WordPress默认登录界面美化。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'login_style',
'type' => 'switcher',
'title' => '登录界面美化',
),
array(
'id' => 'login_logo_form',
'type' => 'radio',
'title' => '登录框位置',
'inline' => true,
'options' => array(
'left' => '靠左',
'middle' => '居中',
'right' => '靠右',
),
'default' => 'middle',
'dependency'=> array( 'login_style', '==', true ),
),
array(
'id' => 'login_logo',
'type' => 'media',
'title' => '登录页面Logo',
'desc' => '建议200*200 px',
'add_title' => '上传图片',
'dependency'=> array( 'login_style', '==', true ),
),
array(
'id' => 'login_bgimg',
'type' => 'media',
'title' => '登录页面背景图片',
'desc' => '没有建议尺寸,铺满整个屏幕最佳',
'add_title' => '上传图片',
'dependency'=> array( 'login_style', '==', true ),
),
)
) );
//
// WP优化:功能修复/新增
//
DAHUZI::createSection( $prefix, array(
'parent' => 'wp_optimization',
'title' => '功能修复/新增',
'fields' => array(
array(
'id' => 'xintheme_delete_post_attachments',
'type' => 'switcher',
'title' => '',
'label' => '删除文章时删除图片附件。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'xintheme_upload_img_rename',
'type' => 'switcher',
'title' => '',
'label' => '上传图片使用日期重命名。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'xintheme_pubMissedPosts',
'type' => 'switcher',
'title' => '',
'label' => '修复WordPress文章定时发布失败的问题。<a href="#" target="_blank">查看详细介绍</a>',
),
array(
'id' => 'redirect_search',
'type' => 'switcher',
'title' => '',
'label' => '修改搜索结果的链接,修改前:域名/?s=搜索词,修改后:域名/search/搜索词。<a href="#" target="_blank">查看详细介绍</a>',
),
)
) );
//
// 扩展功能
//
DAHUZI::createSection( $prefix, array(
'id' => 'extend_fields',
'title' => '扩展功能',
//'icon' => 'fa fa-tint',
) );
//
// 扩展功能:SMTP邮箱设置
//
DAHUZI::createSection( $prefix, array(
'parent' => 'extend_fields',
'title' => 'SMTP邮箱设置',
'fields' => array(
array(
'id' => 'smtp_switcher',
'type' => 'switcher',
'title' => '启用SMTP服务',
),
array(
'id' => 'dahuzi_email',
'type' => 'text',
'title' => '发件人邮箱',
'desc' => '请输入您的邮箱地址',
'attributes' => array('style'=> 'width: 50%;'),
'dependency' => array( 'smtp_switcher', '==', true ),
),
array(
'id' => 'dahuzi_mailname',
'type' => 'text',
'title' => '发件人昵称',
'desc' => '请输入发件人昵称',
'attributes' => array('style'=> 'width: 50%;'),
'dependency' => array( 'smtp_switcher', '==', true ),
),
array(
'id' => 'dahuzi_mailsmtp',
'type' => 'text',
'title' => 'SMTP服务器地址',
'desc' => '请输入您邮箱的SMTP服务器地址',
'default' => 'smtp.qq.com',
'attributes' => array('style'=> 'width: 50%;'),
'dependency' => array( 'smtp_switcher', '==', true ),
),
array(
'id' => 'dahuzi_smtpssl',
'type' => 'switcher',
'title' => 'SSL安全连接',
'default' => true,
'dependency' => array( 'smtp_switcher', '==', true ),
),
array(
'id' => 'dahuzi_mailport',
'type' => 'number',
'title' => 'SMTP服务器端口',
'default' => '465',
'attributes' => array('style'=> 'width: 50%;'),
'dependency' => array( 'smtp_switcher', '==', true ),
),
array(
'id' => 'dahuzi_mailuser',
'type' => 'text',
'title' => '邮箱帐号',
'desc' => '请输入您的邮箱地址,例如:670088886@qq.com',
'attributes' => array('style'=> 'width: 50%;'),
'dependency' => array( 'smtp_switcher', '==', true ),
),
array(
'id' => 'dahuzi_mailpass',
'type' => 'text',
'title' => '邮箱认证密码',
'desc' => '如果使用QQ邮箱,这里输入的不是QQ密码,请前往QQ邮箱 - 设置 - 账户中生成授权码',
'attributes' => array('style'=> 'width: 50%;'),
'dependency' => array( 'smtp_switcher', '==', true ),
),
)
) );
//
// 扩展功能:对象储存
//
DAHUZI::createSection( $prefix, array(
'parent' => 'extend_fields',
'title' => '对象储存',
'fields' => array(
array(
'id' => 'cdn_type',
'type' => 'select',
'title' => '选择云储存',
'options' => array(
'0' => '选择云储存',
'qiniu' => '七牛云储存',
'alioss' => '阿里云OSS'
),
),
array(
'id' => 'cdn_url',
'type' => 'text',
'title' => '加速域名',
'after' => '<p class="cs-text-muted">不要忘记了“http(s)://”</p>',
'attributes'=> array('style'=> 'width: 50%;'),
'dependency'=> array( 'cdn_type', 'any', 'qiniu,alioss' )
),
array(
'id' => 'cdn_file_format',
'type' => 'text',
'title' => '镜像文件格式',
'default' => 'png|jpg|jpeg|gif|ico|7z|zip|rar|pdf|ppt|wmv|mp4|avi|mp3|txt',
'after' => '<p class="cs-text-muted">在输入框内添加准备镜像的文件格式,比如png|jpg|jpeg|gif|ico|html|7z|zip|rar|pdf|ppt|wmv|mp4|avi|mp3|txt(使用|分隔)</p>',
'attributes'=> array('style'=> 'width: 50%;'),
'dependency'=> array( 'cdn_type', 'any', 'qiniu,alioss' )
),
array(
'id' => 'cdn_mirror_folder',
'type' => 'text',
'title' => '镜像文件夹',
'default' => 'wp-content|wp-includes',
'after' => '<p class="cs-text-muted">在输入框内添加准备镜像的文件夹,比如wp-content|wp-includes(使用|分隔)</p>',
'attributes'=> array('style'=> 'width: 50%;'),
'dependency'=> array( 'cdn_type', 'any', 'qiniu,alioss' )
),
)
) );
//
// 扩展功能:链接转换
//
DAHUZI::createSection( $prefix, array(
'parent' => 'extend_fields',
'title' => '链接转换',
'fields' => array(
array(
'id' => 'xintheme_simple_urls',
'type' => 'switcher',
'title' => '外链转内链',
'desc' => '开启后刷新一下页面即可在菜单栏显示按钮',
'help' => '集成Simple Urls外链转内链插件,开启即可使用。',
'default' => false
),
)
) );
//
// 扩展功能:数据库优化清理
//
DAHUZI::createSection( $prefix, array(
'parent' => 'extend_fields',
'title' => '数据库优化清理',
'fields' => array(
array(
'id' => 'xintheme_wp-clean-up',
'type' => 'switcher',
'title' => '数据库优化清理',
'desc' => '开启后刷新一下页面,在外观 - 数据库清理 中进行优化',
'help' => '集成wp-clean-up插件,WordPress数据库优化,它包含删除冗余数据和数据库优化两大功能,操作界面十分简洁易于理解。',
'default' => false
),
)
) );
//
// 扩展功能:站点地图(Sitemap)
//
DAHUZI::createSection( $prefix, array(
'parent' => 'extend_fields',
'title' => '站点地图(Sitemap)',
'fields' => array(
array(
'id' => 'xintheme_sitemap',
'type' => 'switcher',
'title' => '站点地图',
'desc' => '开启后刷新一下页面,在外观 - 站点地图 中进行设置',
'help' => '自动生成xml文件,遵循Sitemap协议,用于指引搜索引擎快速、全面的抓取或更新网站上内容。兼容百度、google、360等主流搜索引擎。',
'default' => false
),
)
) );
//
// 添加代码
//
DAHUZI::createSection( $prefix, array(
'title' => '添加代码',
'fields' => array(
array(
'id' => 'code_head',
'type' => 'code_editor',
'sanitize' => false,
'title' => '添加到头部',
'desc' => '支持html、css、js,js请添加<script>闭合标签,css请添加<style>闭合标签',
'settings' => array(
'theme' => 'shadowfox',
'mode' => 'htmlmixed',
),
),
array(
'id' => 'code_foot',
'type' => 'code_editor',
'sanitize' => false,
'title' => '添加到页脚',
'desc' => '支持html、css、js,js请添加<script>闭合标签,css请添加<style>闭合标签',
'settings' => array(
'theme' => 'shadowfox',
'mode' => 'htmlmixed',
),
),
)
) );
//
// 主题更新
//
DAHUZI::createSection( $prefix, array(
'title' => '禁用主题更新',
'fields' => array(
array(
'id' => 'dahuzi_theme_update',
'type' => 'switcher',
'title' => '禁用主题更新',
'desc' => '开启后,后台将不再显示主题更新提示,如果你以后都不需要更新主题了,则可以开启',
'default' => false
),
)
) );
add_action('admin_head',function(){ ?>
<style type="text/css">
.csf-content{min-height:74vh}
</style>
<?php });