EDIT 我正在尝试更改<form>
元素以及<input>
/使用提交按钮字段comment_form()
作用不管怎样,各种字符串值都会被回显,而不是替换默认值(请参见演示链接)。
CODE:
<?php if ( comments_open() ) : ?>
<?php
$req = get_option( \'require_name_email\' );
$aria_req = ( $req ? \' aria-required="true"\' : \'\' );
$fields = array(
\'id_form\' => \'comment-form\',
\'class_form\' => \'form-inline\',
\'class_submit\' => \'btn btn-default\',
\'author\' => \'<div class="form-group">
<label for="comment-author" class="sr-only">\' . __( \'Author\', \'magneton\' ) . \'</label>
<input type="text" name="author" id="comment-author" class="form-control" placeholder="\' . __( \'Author (required)\', \'magneton\' ) . \'"\' . $aria_req . \'>\',
\'email\' => \'<label for="comment-author-email" class="sr-only">\' . __( \'E-Mail\', \'magneton\' ) . \'</label>
<input type="email" name="email" id="comment-author-email" class="form-control" placeholder="\' . __( \'E-Mail (required)\', \'magneton\' ) . \'"\' . $aria_req . \'>\',
\'url\' => \'<label for="comment-author-url" class="sr-only">\' . __( \'Website\', \'magneton\' ) . \'</label>
<input type="url" name="url" id="comment-author-url" class="form-control" placeholder="\' . __( \'Website\'. \'magneton\' ) . \'">
</div>\'
);
$comments_args = array(
\'fields\' => $fields,
\'title_reply\' => __( \'Leave a reply\', \'magneton\' ),
\'comment_field\' => \'<textarea name="comment" id="comment" class="form-control" aria-required="true" rows="10"></textarea>\',
\'label_submit\' => __( \'Submit Comment\', \'magneton\' )
);
?>
<?php comment_form( $comments_args ); ?>
<?php endif; ?>
LINK: DEMO