[wp-trac] [WordPress Trac] #51082: Default value for comment_type changed can lead to comments not shown and malfunctioning plugins

WordPress Trac noreply at wordpress.org
Fri Dec 17 15:45:14 UTC 2021


#51082: Default value for comment_type changed can lead to comments not shown and
malfunctioning plugins
--------------------------+------------------------------
 Reporter:  Ov3rfly       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Comments      |     Version:  5.5
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by cinemamayhem):

 Replying to [comment:10 SergeyBiryukov]:
 > Replying to [ticket:51082 Ov3rfly]:
 > > The theme in question uses a callback function for
 `wp_list_comments()` with this code:
 > >
 > > {{{
 > > switch ( $comment->comment_type ) :
 > >     case '' :
 > >             // print normal comment here...
 > >             break;
 > >     case 'pingback'  :
 > >     case 'trackback' :
 > >             break;
 > > endswitch;
 > > }}}
 >
 > Here's a workaround for any themes using that pattern:
 > {{{
 > function wp51082_restore_empty_comment_type_on_frontend( $comment ) {
 >       if ( ! is_admin() && 'comment' === $comment->comment_type ) {
 >               $comment->comment_type = '';
 >       }
 >
 >       return $comment;
 > }
 > add_filter( 'get_comment',
 'wp51082_restore_empty_comment_type_on_frontend' );
 > }}}
 >
 > In my testing, this makes comments display again an older version of
 Twenty Ten, before it was updated in [47597].
 >
 > I don't have any Artisteer themes to test, but it should probably work
 for them too.

 I've tried adding this to my Aristeer theme, but it just stalls out when I
 try to update the functions.php portion. WP just takes forever and then
 says it didn't save.

 Is there another work around here? Or can someone tell me what I'm doing
 wrong here (please don't say stop using Artisteer themes, I've used them
 on my sites for ages) but the fact that comments are now hidden is really
 troublesome.

 Any help would be appreciated.

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


More information about the wp-trac mailing list