Opened 9 years ago
Closed 9 years ago
#33482 closed defect (bug) (invalid)
Filter "comment_form_default_fields" removes all fields except textarea for comment
Reported by: | bhdzllr | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.3 |
Component: | Comments | Keywords: | |
Focuses: | template | Cc: |
Description
When trying to use the filter "comment_form_default_fields" just the textarea for the comment is displayed. Other fields (Name, E-Mail, etc.) disappear.
Tried with own template and also with the following snippet in "Twenty Fifteen". Works before updating to WordPress 4.3. Maybe it has something to do with #30157?
function my_comment_form() { // Code } add_filter( 'comment_form_default_fields', 'my_comment_form' );
Change History (3)
Note: See
TracTickets for help on using
tickets.
Hey there, thanks for your report!
Just wanna confirm you're correctly using the
comment_form_default_fields
filter. Unlike actions, it's important that you return the data passed to the callback specified in youradd_filter
call again. Like this:Otherwise this won't work. I can't reproduce any problems with this filter on a clean install and there haven't been any changes to the default comment fields recently. #30157 would only have an impact on the
comment_form_defaults
filter. If your filter looks like the example above, try disabling all plugins & using the default themes to reproduce this.Have a look at the source code for details.
If you have more questions regarding the comment form fields, I suggest asking in the support forums.