From 03ed816d96fb610f4628afe3779458a2ee3c7ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E8=90=BD?= Date: Sat, 25 Jan 2020 22:50:40 +0800 Subject: [PATCH] add --- framework/load.php | 14 + framework/options-config.php | 6 +- .../{theme-options.php => plugin-options.php} | 94 +++-- functions/func_load.php | 3 +- functions/optimization.php | 308 ---------------- functions/utils.php | 335 ++++++++++++++++++ route.php | 1 + 7 files changed, 399 insertions(+), 362 deletions(-) create mode 100644 framework/load.php rename framework/{theme-options.php => plugin-options.php} (76%) create mode 100644 functions/utils.php diff --git a/framework/load.php b/framework/load.php new file mode 100644 index 0000000..81aee17 --- /dev/null +++ b/framework/load.php @@ -0,0 +1,14 @@ + array( array( 'name' => '滚动内容来源', @@ -838,7 +838,7 @@ $theme_options = array( 'desc' => '如果您想使用自定义的RSS地址,请在这里输入您期望的地址。', 'id' => 'git_rss', 'type' => 'text', - 'std' => get_bloginfo('rss2_url') + 'std' => '', ), array( 'name' => '新浪微博', @@ -1503,7 +1503,7 @@ $theme_options = array( 'desc' => '填写一个正方形的图片,显示在推送信息左侧,默认为默认头像', 'id' => 'git_notification_icon', 'type' => 'text', - 'std' => deel_avatar_default() + 'std' => '', ), array( 'name' => 'HTML5推送链接【可选】', diff --git a/framework/theme-options.php b/framework/plugin-options.php similarity index 76% rename from framework/theme-options.php rename to framework/plugin-options.php index abda1a7..64b30b2 100644 --- a/framework/theme-options.php +++ b/framework/plugin-options.php @@ -8,43 +8,40 @@ } $current_theme = wp_get_theme(); -$default_options = array(); -$theme_options = array(); -require('options-config.php'); -$current_options = get_option('git_options_setup', array()); +$gdk_default_options = []; +$gdk_options = []; +include('options-config.php'); +$gdk_current_options = get_option('gdk_options_setup', []); -function git_update_options() { - global $default_options, $theme_options, $current_options; - $default_options = array(); - $current_options = get_option('git_options_setup', array()); - foreach ($theme_options as $panel) { +function gdk_update_options() { + global $gdk_default_options, $gdk_options, $gdk_current_options; + foreach ($gdk_options as $panel) { foreach ($panel as $option) { $id = $option['id']; $type = $option['type']; if ( !$id ) continue; - $default_options[$id] = $option['std']; - if ( isset($current_options[$id]) ) continue; - $current_options[$id] = isset( $option['std'] ) ? $option['std'] : ''; + $gdk_default_options[$id] = $option['std']; + if ( isset($gdk_current_options[$id]) ) continue; + $gdk_current_options[$id] = isset( $option['std'] ) ? $option['std'] : ''; } } } -git_update_options(); +gdk_update_options(); //获取设置选项 -function git_get_option($id, $returnDefault = false) { - global $default_options, $current_options; - return stripslashes( $returnDefault ? $default_options[$id] : $current_options[$id] ); +function gdk_get_option($id, $returnDefault = false) { + global $gdk_default_options, $gdk_current_options; + return stripslashes( $returnDefault ? $gdk_default_options[$id] : $gdk_current_options[$id] ); } //设置页面模板 -function git_theme_options_page() { - global $theme_options, $current_theme; +function gdk_options_page() { + global $gdk_options; ?>
-

Git 主题选项

+

GDK选项

-

您的网站分类列表:

设置已保存。

'; @@ -56,7 +53,7 @@ function git_theme_options_page() {