feat(forum): add complete forum workflows
This commit is contained in:
1 parent
a254cbd3e9
commit
ee65fc7fd2
39 files changed
+3425
-4
No files matched your search
@@ -417,8 +417,10 @@ function jio_notify_post_author_of_comment(WP_Comment $comment): void {
|
||||
if ($owner_id <= 0 || $owner_id === (int) $comment->user_id) return;
|
||||
jio_add_user_notification($owner_id, [
|
||||
'type' => 'comment',
|
||||
'title' => __('文章收到评论', 'jio'),
|
||||
'desc' => sprintf(__('%1$s 评论了你的文章《%2$s》。', 'jio'), get_comment_author($comment), get_the_title($post)),
|
||||
'title' => $post->post_type === \Jio\Forum\Core::POST ? __('帖子收到回复', 'jio') : __('文章收到评论', 'jio'),
|
||||
'desc' => $post->post_type === \Jio\Forum\Core::POST
|
||||
? sprintf(__('%1$s 回复了你的帖子《%2$s》。', 'jio'), get_comment_author($comment), get_the_title($post))
|
||||
: sprintf(__('%1$s 评论了你的文章《%2$s》。', 'jio'), get_comment_author($comment), get_the_title($post)),
|
||||
'url' => get_comment_link($comment),
|
||||
]);
|
||||
update_comment_meta($comment->comment_ID, 'jio_post_comment_notified', 1);
|
||||
|
||||
@@ -43,6 +43,12 @@ $_jio_special_templates = [
|
||||
'title' => '发布文章',
|
||||
'fallback' => '/submit/',
|
||||
],
|
||||
'forums' => [
|
||||
'file' => 'templates/pages/page-forums.php',
|
||||
'slug' => 'forums',
|
||||
'title' => '论坛',
|
||||
'fallback' => '/forums/',
|
||||
],
|
||||
];
|
||||
|
||||
/** @var array 缓存 key=模板文件路径 => value=WP_Post|null */
|
||||
|
||||
Reference in new issue
Block a user