gpt4 book ai didi

php - 从 wordpress 评论中删除框

转载 作者:搜寻专家 更新时间:2023-10-31 21:55:34 31 4
gpt4 key购买 nike

我希望有人可以帮助我解决这个问题或为我指明正确的方向。我现在正在拔头发。

在 wordpress 评论表上。我有这些盒子:

Screenshot

我查看了 wordpress 函数页面:https://codex.wordpress.org/Function_Reference/comment_form其中提到了这个 'comment_notes_before' => '' - 即使我将值设为空白,它仍然会添加那些该死的框!!!!

有人可以告诉我如何删除它们吗?

p.s 我使用的是标准 comment_form($comments_args); 实现而不是自定义表单。

谢谢

编辑:完整代码

<?php
$fields = array(

// author field
'author' => '',

//email field
'email' => '',

'comment_notes_before' => '',
'comment_notes_after' => ''

);
?>

<?php

$comments_args = array(
'id_form' => 'commentform',
'class_form' => 'comment-form',
'id_submit' => 'submit',
'class_submit' => 'submit',
'name_submit' => 'submit',
'title_reply' => __( 'Leave a Reply' ),
'title_reply_to' => __( 'Leave a Reply to %s' ),
'cancel_reply_link' => __( 'Cancel Reply' ),
'label_submit' => __( 'Post Comment' ),
'format' => 'xhtml',

'comment_field' => '<p class="comment-form-comment"><label for="comment">Comment</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true">' .
'</textarea></p>',

'must_log_in' => '<p class="must-log-in">' .
sprintf(
__( 'You must be <a href="%s">logged in</a> to post a comment.' ),
wp_login_url( apply_filters( 'the_permalink', get_permalink() ) )
) . '</p>',

'logged_in_as' => '<p class="logged-in-as">' .
sprintf(
__( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ),
admin_url( 'profile.php' ),
$user_identity,
wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) )
) . '</p>',

'fields' => apply_filters( 'comment_form_default_fields', $fields ),
);
?>

最佳答案

使用 CSS 选择器来设置评论区域的样式绝对是最好的方式,因为没有 WordPress 钩子(Hook)来控制它。

i had a quick look at the documentation, i can't see where you remove the buttons, if its the same set up as the text editors they are addd with js, but you can use css and set them to display: none which would be a quick solution. – David Dec 16 '15 at 1:18

David 的想法很正确,而且看起来成功了。在浏览评论之前,我在上面 - CSS!!!

我正在回答这个问题,所以它不再显示为未回答。

关于php - 从 wordpress 评论中删除框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34301804/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com