Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I see that there are lots of filters and things you can do to remove fields or modify them. I have found some useful ones on this site. I want to take it a step further because I want to do some things that there does not seem to be a filter for. Like removing the labels. At least I have not found one yet. I also need to remove the submit button and want to replace it with an actual button. For styling purposes. So I thought I could copy the comment_form function out of the wp-includes/comment-template.php file and put it in my functions.php file so that I could make any modifications I wanted. Problem with that is that WordPress throws you one of those previously declared functions errors. So I was looking for the filter or action to unregister that function so that I can use it in my functions.php file but I can't find it. Do you know how I can do this?

I tried

 remove_action('comment_form');

but this did not work

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

That function is called directly in a theme, probably in comments.php. Remove the function call there, and use your own function with a different name.

Be aware many plugins rely on the code in the native function. If you change too much, some plugin might break.

You can edit the label element with a filter on 'comment_form_default_fields'. Please do not remove them, they are important for screen reader users.

share|improve this answer
    
I tried to modify the fields by passing args but the labels still show up. maybe it would be better to keep trying to modify it by filters so as to not break any plugins down the road –  Jamie Feb 10 '13 at 3:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.