[wp-trac] [WordPress Trac] #32312: Post Comment button disappeared in some themes

WordPress Trac noreply at wordpress.org
Tue May 19 01:03:11 UTC 2015


#32312: Post Comment button disappeared in some themes
-----------------------------------+-----------------------------
 Reporter:  SergeyBiryukov         |       Owner:  SergeyBiryukov
     Type:  defect (bug)           |      Status:  assigned
 Priority:  normal                 |   Milestone:  4.2.3
Component:  Comments               |     Version:  4.2
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:2 boonebgorges]:
 > The only backward compatibility concern would be `isset()` checks
 expecting a given array key to be missing after filtering the default
 arguments. I don't see anything like that in `comment_form()`, and `$args`
 is never passed to a hook that might do a similar trick, but it would be
 nice to get another set of eyes.

 This would no longer work with the `array_merge()`:
 {{{
 function mytheme_comments_form_defaults( $defaults ) {
         unset( $defaults['comment_notes_after'] );
         return $defaults;
 }
 add_filter( 'comment_form_defaults', 'mytheme_comments_form_defaults' );
 }}}

 But it currently produces a notice anyway, and there's a more correct way
 to do it:
 {{{
 function mytheme_comments_form_defaults( $defaults ) {
         $defaults['comment_notes_after'] = '';
         return $defaults;
 }
 add_filter( 'comment_form_defaults', 'mytheme_comments_form_defaults' );
 }}}
 So I'd suggest going with your fix.

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


More information about the wp-trac mailing list