v1.7 — 登录态 + 评论优化
- 隐藏 WP admin bar - 导航栏右侧登录用户头像+姓名下拉菜单 - 笺文评论:只显示输入框+按钮,未登录点提交提示登录 - 评论无需审核直接显示
This commit is contained in:
@@ -122,6 +122,9 @@ remove_action('admin_print_styles', 'print_emoji_styles');
|
||||
|
||||
add_filter('emoji_svg_url', '__return_false');
|
||||
|
||||
// 隐藏顶部 admin bar
|
||||
add_filter('show_admin_bar', '__return_false');
|
||||
|
||||
// 评论表单中文化
|
||||
add_filter('comment_form_default_fields', function($fields) {
|
||||
$fields['author'] = '<p class="comment-form-author"><label for="author">显示名称</label><input id="author" name="author" type="text" size="30" /></p>';
|
||||
@@ -131,6 +134,9 @@ add_filter('comment_form_default_fields', function($fields) {
|
||||
return $fields;
|
||||
});
|
||||
|
||||
// 评论无需审核直接发布
|
||||
add_filter('pre_comment_approved', function() { return 1; });
|
||||
|
||||
add_action('template_include', function($template) {
|
||||
if (get_query_var('post_type') === 'post' && !is_home() && !is_singular()) {
|
||||
$t = locate_template('archive.php');
|
||||
|
||||
Reference in New Issue
Block a user