[wp-trac] [WordPress Trac] #41009: Add filter to comment form class

WordPress Trac noreply at wordpress.org
Mon Jun 12 13:04:11 UTC 2017


#41009: Add filter to comment form class
-----------------------------+-----------------------------
 Reporter:  cjbj             |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Comments         |    Version:  4.7
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Almost all html of the comment_form function can be customized using
 filters, except for this line (current 2285 in comment-template.php),
 which is the wrapping div of the comment form:

 {{{
 <div id="respond" class="comment-respond">
 }}}

 I feel there are legitimate reasons for wanting at least the class to be
 filterable. For instance if you are using the clearfix class throughout
 your design to clear floats. So I would like to propose changing this line
 to this:


 {{{
 $respond_class = 'comment-respond';
 $respond_class = apply_filters ('comment_form_respond_class'
 ,$respond_class);
 echo '<div id="respond" class="' . esc_attr($respond_class) . '">';
 }}}

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


More information about the wp-trac mailing list