[wp-trac] [WordPress Trac] #20302: Allow comment_form() to add attributes to <form> tag

WordPress Trac noreply at wordpress.org
Mon May 9 22:01:18 UTC 2016


#20302: Allow comment_form() to add attributes to <form> tag
-------------------------------------------------+-------------------------
 Reporter:  psbook                               |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  Comments                             |  Release
 Severity:  normal                               |     Version:  3.3.1
 Keywords:  has-patch has-unit-tests needs-      |  Resolution:
  refresh                                        |     Focuses:
-------------------------------------------------+-------------------------
Changes (by rachelbaker):

 * keywords:  has-patch has-unit-tests => has-patch has-unit-tests needs-
     refresh
 * milestone:  Awaiting Review => Future Release


Comment:

 The comment form `action` attribute is already filterable via
 `comment_form_defaults()`. See #26841.

 During our Comments bug scrub @boonebgorges
 [https://wordpress.slack.com/archives/core-comments/p1462824129000166
 suggested creating a new filter], to prevent filter stacking and letting
 the `comment_form_defaults` filter get *even more* out of hand.  His
 example:

 {{{
 $addl_attributes = apply_filters( 'comment_form_additional_attributes',
 array() );

 if ( $addl_attributes ) {
     // do stuff.
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/20302#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list