Skip to content

Commit 6d54627

Browse files
committed
feat(Version 2.2.1): ✨ Add setting to change comment tag url
1 parent 9ba98b0 commit 6d54627

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

include/comment.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,9 @@ function comment_mark($comment)
343343
//判断是不是站长我
344344
if ($comment->comment_author_email == $adminEmail) {
345345
$comment_mark =
346-
'<a target="_blank" href="/about" title="' .
346+
'<a target="_blank" href="' .
347+
get_option('origami_comment_admin_url', '/about') .
348+
'" title="' .
347349
__('经鉴定,这货是站长', 'origami') .
348350
'">' .
349351
__('站长', 'origami') .
@@ -371,7 +373,9 @@ function comment_mark($comment)
371373
$comment_author_url_reg == $url_re[2]
372374
) {
373375
$comment_mark =
374-
'<a target="_blank" href="/links" title="' .
376+
'<a target="_blank" href="' .
377+
get_option('origami_comment_friend_url', '/links') .
378+
'" title="' .
375379
__('友情链接认证', 'origami') .
376380
'">' .
377381
__('友人', 'origami') .

include/config.class.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,8 @@ public function admin_init()
529529
register_setting('origami_fun', 'origami_mail_notice_title');
530530
register_setting('origami_fun', 'origami_mail_notice_salute');
531531
register_setting('origami_fun', 'origami_mail_notice_footer');
532+
register_setting('origami_fun', 'origami_comment_admin_url');
533+
register_setting('origami_fun', 'origami_comment_friend_url');
532534
add_settings_section(
533535
'origami_fun_comment',
534536
__('3.评论设置', 'origami'),
@@ -700,6 +702,30 @@ public function admin_init()
700702
'type' => 'textarea'
701703
]
702704
);
705+
add_settings_field(
706+
'origami_comment_admin_url',
707+
__('评论标记URL(admin)', 'origami'),
708+
[&$this, 'settings_field_input_text'],
709+
'origami_fun',
710+
'origami_fun_comment',
711+
[
712+
'field' => 'origami_comment_admin_url',
713+
'value' => '/about',
714+
'type' => 'text'
715+
]
716+
);
717+
add_settings_field(
718+
'origami_comment_friend_url',
719+
__('评论标记URL(friend)', 'origami'),
720+
[&$this, 'settings_field_input_text'],
721+
'origami_fun',
722+
'origami_fun_comment',
723+
[
724+
'field' => 'origami_comment_friend_url',
725+
'value' => '/links',
726+
'type' => 'text'
727+
]
728+
);
703729

704730
// 其他
705731
register_setting('origami_fun', 'origami_copy_add_copyright');

style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Theme URI: https://blog.ixk.me/theme-origami.html
55
Author: Otstar Lin
66
Author URI: https://www.ixk.me
77
Description: 简约平面化风格的主题
8-
Version: 2.2.0
8+
Version: 2.2.1
99
License: GNU General Public License v3 or later
1010
License URI: http://www.gnu.org/licenses/gpl-3.0.html
1111
Tags: black,cyan-blue,flat,responsive

style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Theme URI: https://blog.ixk.me/theme-origami.html
44
Author: Otstar Lin
55
Author URI: https://www.ixk.me
66
Description: 简约平面化风格的主题
7-
Version: 2.2.0
7+
Version: 2.2.1
88
License: GNU General Public License v3 or later
99
License URI: http://www.gnu.org/licenses/gpl-3.0.html
1010
Tags: black,cyan-blue,flat,responsive

0 commit comments

Comments
 (0)