Skip to content

Commit

Permalink
feat(Version 2.2.1): ✨ Add setting to change comment tag url
Browse files Browse the repository at this point in the history
  • Loading branch information
syfxlin committed Jan 15, 2020
1 parent 9ba98b0 commit 6d54627
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
8 changes: 6 additions & 2 deletions include/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,9 @@ function comment_mark($comment)
//判断是不是站长我
if ($comment->comment_author_email == $adminEmail) {
$comment_mark =
'<a target="_blank" href="/about" title="' .
'<a target="_blank" href="' .
get_option('origami_comment_admin_url', '/about') .
'" title="' .
__('经鉴定,这货是站长', 'origami') .
'">' .
__('站长', 'origami') .
Expand Down Expand Up @@ -371,7 +373,9 @@ function comment_mark($comment)
$comment_author_url_reg == $url_re[2]
) {
$comment_mark =
'<a target="_blank" href="/links" title="' .
'<a target="_blank" href="' .
get_option('origami_comment_friend_url', '/links') .
'" title="' .
__('友情链接认证', 'origami') .
'">' .
__('友人', 'origami') .
Expand Down
26 changes: 26 additions & 0 deletions include/config.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@ public function admin_init()
register_setting('origami_fun', 'origami_mail_notice_title');
register_setting('origami_fun', 'origami_mail_notice_salute');
register_setting('origami_fun', 'origami_mail_notice_footer');
register_setting('origami_fun', 'origami_comment_admin_url');
register_setting('origami_fun', 'origami_comment_friend_url');
add_settings_section(
'origami_fun_comment',
__('3.评论设置', 'origami'),
Expand Down Expand Up @@ -700,6 +702,30 @@ public function admin_init()
'type' => 'textarea'
]
);
add_settings_field(
'origami_comment_admin_url',
__('评论标记URL(admin)', 'origami'),
[&$this, 'settings_field_input_text'],
'origami_fun',
'origami_fun_comment',
[
'field' => 'origami_comment_admin_url',
'value' => '/about',
'type' => 'text'
]
);
add_settings_field(
'origami_comment_friend_url',
__('评论标记URL(friend)', 'origami'),
[&$this, 'settings_field_input_text'],
'origami_fun',
'origami_fun_comment',
[
'field' => 'origami_comment_friend_url',
'value' => '/links',
'type' => 'text'
]
);

// 其他
register_setting('origami_fun', 'origami_copy_add_copyright');
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Theme URI: https://blog.ixk.me/theme-origami.html
Author: Otstar Lin
Author URI: https://www.ixk.me
Description: 简约平面化风格的主题
Version: 2.2.0
Version: 2.2.1
License: GNU General Public License v3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Tags: black,cyan-blue,flat,responsive
Expand Down
2 changes: 1 addition & 1 deletion style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: https://blog.ixk.me/theme-origami.html
Author: Otstar Lin
Author URI: https://www.ixk.me
Description: 简约平面化风格的主题
Version: 2.2.0
Version: 2.2.1
License: GNU General Public License v3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Tags: black,cyan-blue,flat,responsive
Expand Down

0 comments on commit 6d54627

Please sign in to comment.