【发布时间】:2016-01-28 06:06:53
【问题描述】:
我希望有人可以帮助我或为我指明正确的方向。我现在正在拔头发。
在 wordpress cmets 表单上。我有这些盒子:
我查看了 wordpress 功能页面:https://codex.wordpress.org/Function_Reference/comment_form 其中提到了这个 'comment_notes_before' => '' - 即使我将值设为空白,它仍然会添加那些该死的框!!!!
谁能告诉我如何删除它们?
p.s 我使用的是标准的 comment_form($cmets_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 ),
);
?>
【问题讨论】:
-
感谢您的回复,但很遗憾没有。我希望 cmets 表单可见我只是不希望评论 textarea 字段上方的那些小框
-
那些“框”表示用户可以使用哪些标签。这些可以被
comment_notes_after参数抑制(不确定你在哪里得到'comment_notes_before')。此外,我们需要查看您的完整代码,以及您的主题/插件可能会劫持这一事实。 -
添加了完整的代码。我已经将 _before 和 _after 都设置为 ' '。 ://
-
我快速浏览了文档,我看不到您删除按钮的位置,如果它与使用 js 添加的文本编辑器相同,但您可以使用 css 和将它们设置为
display: none,这将是一个快速的解决方案。