[wp-trac] [WordPress Trac] #54283: Add a hook to allow themes to remove the "Comments are closed." sentence on pages

WordPress Trac noreply at wordpress.org
Mon Oct 18 09:29:57 UTC 2021


#54283: Add a hook to allow themes to remove the "Comments are closed." sentence on
pages
--------------------------------------------------+---------------------
 Reporter:  audrasjb                              |       Owner:  (none)
     Type:  feature request                       |      Status:  new
 Priority:  normal                                |   Milestone:  5.9
Component:  Comments                              |     Version:
 Severity:  normal                                |  Resolution:
 Keywords:  needs-dev-note 2nd-opinion has-patch  |     Focuses:
--------------------------------------------------+---------------------
Changes (by audrasjb):

 * keywords:  needs-dev-note needs-patch 2nd-opinion => needs-dev-note 2nd-
     opinion has-patch


Comment:

 This patch can be tested using this snippet:

 {{{
 function mytheme_comments_closed_message( $message, $post ) {
         if ( 'page' === $post->post_type ) {
                 return;
         }
         return $message;
 }
 add_filter( 'comments_closed_message', 'mytheme_comments_closed_message',
 10, 2 );
 }}}

 Using this snippet, the "Comments are closed." message won't be displayed
 anymore on Page with comments disabled.

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


More information about the wp-trac mailing list