Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 134460

rahat.haider on "[Plugin: comments] Add new field in Comment box"

$
0
0

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 all articles
Browse latest Browse all 134460

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>