From 4712cb469c5c62dcf574bd121a338dca1e4bfa51 Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Fri, 23 Jan 2026 15:49:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=B8=85=E7=90=86=E5=AD=A4?= =?UTF-8?q?=E7=AB=8B=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除未使用的邮件模板类型(user_register, password_reset, general) - 删除 style.css 中未使用的 .shortcode-todo 样式(约30行) - 保留 todo_urge 邮件类型(有实际使用) - 减少约 120 行冗余代码 --- email-templates/base.php | 74 +--------------------------------------- settings.php | 2 +- style.css | 42 ----------------------- 3 files changed, 2 insertions(+), 116 deletions(-) diff --git a/email-templates/base.php b/email-templates/base.php index 4dd46f1..657d974 100644 --- a/email-templates/base.php +++ b/email-templates/base.php @@ -113,44 +113,6 @@ function argon_get_email_types() { 'theme_color' => __('主题色', 'argon'), ), ), - 'user_register' => array( - 'name' => __('用户注册', 'argon'), - 'description' => __('新用户注册成功后发送的欢迎邮件', 'argon'), - 'default_subject' => '[{{blog_name}}] 注册成功', - 'default_content' => '

欢迎加入 {{blog_name}}

-

{{user_name}},您好:

-

您的账户已创建成功,现在可以登录使用了。

-

- 立即登录 -

', - 'placeholders' => array( - 'blog_name' => __('博客名称', 'argon'), - 'user_name' => __('用户名', 'argon'), - 'user_email' => __('用户邮箱', 'argon'), - 'login_url' => __('登录链接', 'argon'), - 'register_date' => __('注册时间', 'argon'), - 'theme_color' => __('主题色', 'argon'), - ), - ), - 'password_reset' => array( - 'name' => __('密码重置', 'argon'), - 'description' => __('用户请求重置密码时发送的邮件', 'argon'), - 'default_subject' => '[{{blog_name}}] 密码重置请求', - 'default_content' => '

密码重置请求

-

{{user_name}},您好:

-

我们收到了您的密码重置请求,请点击下方按钮重置密码。如果这不是您本人的操作,请忽略此邮件。

-

- 重置密码 -

-

此链接将在 24 小时后失效。

', - 'placeholders' => array( - 'blog_name' => __('博客名称', 'argon'), - 'user_name' => __('用户名', 'argon'), - 'user_email' => __('用户邮箱', 'argon'), - 'reset_url' => __('重置链接', 'argon'), - 'theme_color' => __('主题色', 'argon'), - ), - ), 'todo_urge' => array( 'name' => __('TODO 提醒', 'argon'), 'description' => __('访客催促作者完成 TODO 时发送的邮件', 'argon'), @@ -172,20 +134,6 @@ function argon_get_email_types() { 'theme_color' => __('主题色', 'argon'), ), ), - 'general' => array( - 'name' => __('通用邮件', 'argon'), - 'description' => __('其他类型的通用邮件模板', 'argon'), - 'default_subject' => '[{{blog_name}}] {{subject}}', - 'default_content' => '

{{title}}

-
{{content}}
', - 'placeholders' => array( - 'blog_name' => __('博客名称', 'argon'), - 'subject' => __('邮件主题', 'argon'), - 'title' => __('内容标题', 'argon'), - 'content' => __('邮件内容', 'argon'), - 'theme_color' => __('主题色', 'argon'), - ), - ), ); // 允许通过 filter 扩展邮件类型 @@ -539,21 +487,6 @@ function argon_get_sample_email_vars($type) { 'reply_date' => date_i18n(get_option('date_format') . ' ' . get_option('time_format')), )); - case 'user_register': - return array_merge($common, array( - 'user_name' => '新用户', - 'user_email' => 'newuser@example.com', - 'login_url' => wp_login_url(), - 'register_date' => date_i18n(get_option('date_format') . ' ' . get_option('time_format')), - )); - - case 'password_reset': - return array_merge($common, array( - 'user_name' => '用户名', - 'user_email' => 'user@example.com', - 'reset_url' => home_url('/wp-login.php?action=rp&key=sample_key'), - )); - case 'todo_urge': return array_merge($common, array( 'todo_content' => '这是一个示例 TODO 任务内容', @@ -561,13 +494,8 @@ function argon_get_sample_email_vars($type) { 'urge_time' => date_i18n(get_option('date_format') . ' ' . get_option('time_format')), )); - case 'general': default: - return array_merge($common, array( - 'subject' => '示例邮件主题', - 'title' => '示例标题', - 'content' => '

这是通用邮件模板的示例内容。您可以在这里放置任何 HTML 内容。

', - )); + return $common; } } diff --git a/settings.php b/settings.php index aa30fb9..baad97c 100644 --- a/settings.php +++ b/settings.php @@ -6404,7 +6404,7 @@ function argon_update_themeoptions(){ update_option('argon_email_social_links', $social_links); // 保存邮件模板配置 - $email_types = array('comment_notify', 'spam_notify', 'reply_notify', 'user_register', 'password_reset', 'todo_urge', 'general'); + $email_types = array('comment_notify', 'spam_notify', 'reply_notify', 'todo_urge'); foreach ($email_types as $type) { // 保存启用状态 argon_update_option_checkbox('argon_email_template_' . $type . '_enabled'); diff --git a/style.css b/style.css index a32980e..f650373 100644 --- a/style.css +++ b/style.css @@ -6761,48 +6761,6 @@ html.darkmode #post_comment.post-comment-force-privatemode-off .comment-post-pri /*短代码适配*/ -/*短代�?checkbox*/ - -.shortcode-todo { - - cursor: default; - - margin: 3px 0; - -} - -.shortcode-todo .custom-control-input { - - pointer-events: none; - -} - -.shortcode-todo * { - - cursor: default !important; - -} - -.shortcode-todo .custom-control-label span { - - transform: translateY(-2.5px); - - display: block; - - cursor: text !important; - -} - -.shortcode-todo.inline { - - display: inline-block; - - margin-right: 10px; - -} - - - /*短代�?警告与折叠块*/ .admonition,