$defaults = array(
'fields' => $fields,
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>',
/** This filter is documented in wp-includes/link-template.php */
'must_log_in' => '<p class="must-log-in">' . sprintf(
/* translators: %s: login URL */
__( 'You must be <a href="%s">logged in</a> to post a comment.' ),
wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
) . '</p>',
/** This filter is documented in wp-includes/link-template.php */
'logged_in_as' => '<p class="logged-in-as">' . sprintf(
/* translators: 1: edit user link, 2: accessibility text, 3: user name, 4: logout URL */
__( '<a href="%1s"aria−label="s">Logged in as %3s</a>.<ahref="s">Log out?</a>' ),
get_edit_user_link(),
/* translators: %s: user name */
esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
$user_identity,
wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
) . '</p>',
'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . __( 'Your email address will not be published.' ) . '</span>'. ( $req ? $required_text : '' ) . '</p>',
'comment_notes_after' => '',
'id_form' => 'commentform',
'id_submit' => 'submit',
'class_form' => 'comment-form',
'class_submit' => 'submit',
'name_submit' => 'submit',
'title_reply' => __( 'Leave a Reply' ),
'title_reply_to' => __( 'Leave a Reply to %s' ),
'title_reply_before' => '<h3 id="reply-title" class="comment-reply-title">',
'title_reply_after' => '</h3>',
'cancel_reply_before' => ' <small>',
'cancel_reply_after' => '</small>',
'cancel_reply_link' => __( 'Cancel reply' ),
'label_submit' => __( 'Post Comment' ),
'submit_button' => '<input name="%1s"type="submit"id="s" class="%3s"value="s" />',
'submit_field' => '<p class="form-submit">%1ss</p>',
'format' => 'xhtml',
);
初めまして。twentysixteenのコメントカスタムで検索していてお伺いしました。
上記参考にさせていただいて、非常に分かりやすくうまくカスタムできました。
こちらで、メールアドレス欄とウェブサイト欄の削除する方法を探しているのですが、コードはご存じないでしょうか?
検索して入れるとコメント欄自体が消えてしまい困っております。
array(
から設定変更では駄目でしたので、ぶしつけで申し訳ありませんがお分かりにならないでしょうか。
初めまして。ちょっと試してみたのですが、こちらのページを参考に、function.phpに下記を追加した所、このブログでは消すことが出来ました。
(今は表示を戻しています)
■参考にさせて頂いたページ
WordPressのコメント入力欄から不要な項目を消す方法
http://denno-sekai.com/comment-column-edit/
■function.php に追加したコード
// コメントからEmailとウェブサイトを削除
function my_comment_form_remove(arg) {arg[‘url’] = ”;
arg[‘email′]=”;returnarg;
}
add_filter(‘comment_form_default_fields’, ‘my_comment_form_remove’);