我们甚至可以使用“comment\\u form\\u default\\u fields”过滤器向注释中添加字段。将此添加到函数中。我们可以添加如下字段:
function add_comment_fields($fields) {
$fields[\'age\'] = \'<p class="comment-form-age"><label for="age">\' . __( \'Age\' ) . \'</label>\' .
\'<input id="age" name="age" type="text" size="30" /></p>\';
return $fields;
}
add\\u filter(\'comment\\u form\\u default\\u fields\',\'add\\u comment\\u fields\');
#respond .comment-form-author label,
#respond .comment-form-email label,
#respond .comment-form-url label,
#respond .comment-form-age label,
#respond .comment-form-comment label {
background: #eee;
-webkit-box-shadow: 1px 2px 2px rgba(204,204,204,0.8);
-moz-box-shadow: 1px 2px 2px rgba(204,204,204,0.8);
box-shadow: 1px 2px 2px rgba(204,204,204,0.8);
color: #555;
display: inline-block;
font-size: 13px;
left: 4px;
min-width: 60px;
padding: 4px 10px;
position: relative;
top: 40px;
z-index: 1;
}
Reference url