diff --git a/inc/theme-core.php b/inc/theme-core.php index 600fa2a..2507b66 100644 --- a/inc/theme-core.php +++ b/inc/theme-core.php @@ -3,7 +3,7 @@ * 核心函数 * @author Seaton Jiang * @license MIT License - * @version 2021.03.10 + * @version 2021.03.11 */ if (kratos_option('g_cdn', false)) { @@ -91,13 +91,15 @@ function theme_autoload() } add_action('wp_enqueue_scripts', 'theme_autoload'); -// Admin Bar +// 前台管理员导航 if (! kratos_option('g_adminbar', true)) { add_filter('show_admin_bar', '__return_false'); } // 移除自动保存、修订版本 -remove_action('post_updated', 'wp_save_post_revision'); +if (kratos_option('g_post_revision', true)) { + remove_action('post_updated', 'wp_save_post_revision'); +} // 添加友情链接 add_filter('pre_option_link_manager_enabled', '__return_true'); diff --git a/inc/theme-options.php b/inc/theme-options.php index 5b1e459..17e6d1d 100644 --- a/inc/theme-options.php +++ b/inc/theme-options.php @@ -3,7 +3,7 @@ * 主题选项 * @author Seaton Jiang * @license MIT License - * @version 2021.03.10 + * @version 2021.03.11 */ function getrobots() @@ -229,7 +229,7 @@ function kratos_options() $options[] = array( 'name' => __('Gravatar 加速', 'kratos'), 'desc' => __('开启 Gravatar 头像加速', 'kratos'), - 'std' => '0', + 'std' => '1', 'id' => 'g_gravatar', 'type' => 'checkbox', ); @@ -482,6 +482,14 @@ function kratos_options() 'type' => 'checkbox', ); + $options[] = array( + 'name' => __('附加功能', 'kratos'), + 'desc' => __('关闭文章自动保存、修订版本功能', 'kratos'), + 'id' => 'g_post_revision', + 'type' => 'checkbox', + 'std' => '1', + ); + $options[] = array( 'name' => __('文章打赏', 'kratos'), 'desc' => __('开启文章页面打赏功能', 'kratos'),