How to add a class to the comment submit button?

If you check out the source of the function comment_form(), you’ll see it doesn’t even print a class on the input;

<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />

I’m guessing you need to add a class for styling? Why not modify your CSS to just;

input.submit, #buttonPro {
    /* some awesome style */
}

Otherwise I guess the ‘easiest’ solution would be to simply copy the function to your functions.php, rename it, add in a class argument & print, and use that instead – which you can find here 😉

Leave a Comment