Add new field in Comment box
-
I am trying to add new field in the comment form by using filters.
here is my code
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_filter('comment_form_default_fields','add_comment_fields');
i also check for the filter and hook reference and found that comment_form_default_fields
is empty.
My question is that how can i add or remove fields in comment form.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Add new field in Comment box’ is closed to new replies.