[wp-trac] [WordPress Trac] #46006: comment_form() function doesn't call `comment_form_after_fields` action if fields was set to empty array

WordPress Trac noreply at wordpress.org
Wed Jan 16 11:44:58 UTC 2019


#46006: comment_form() function doesn't call `comment_form_after_fields` action if
fields was set to empty array
--------------------------+-----------------------------
 Reporter:  Guss77        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Comments      |    Version:  4.4.3
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This is apparently since WordPress 4.4 - before that, if you called:

     commend_form([ 'fields' => [] ]);

 Then the process for not logged in users would be:

 - `comment_form_before_fields` action
 - for each field in `fields` (if any):
   - `comment_form_field_<name>` filter
 - `comment_form_after_fields` action

 In 4.4 this changed to be:

 - for each field in `fields` (if any):
   - if the field is `"comment"` - `comment_form_field_comment` filter
   - otherwise, and if user is not logged in:
     - if its the first field - `comment_form_before_fields`
     - `comment_form_field_<name>` filter
     - if its the last field - `comment_form_after_fields`

 it is easy to see that if the theme designer decided not to use any
 standard field (maybe because she wants to do something crazy, or generate
 the standard field in `comment_form_before_fields` or
 `comment_form_after_fields` action), then their actions would not be
 called.

 This is still an issue in 5.0

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46006>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list