[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:19:05 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           |   Keywords:  needs-dev-note needs-patch
  Focuses:                   |
-----------------------------+----------------------------------------
 Previously: #17568

 By default, the comment template displays a "Comments are closed."
 sentence on pages.

 Until now, theme authors had to create their own management of the display
 of comments in order to remove this mention when you are on a page with
 comments disabled (which is the case by default).

 Today, with the arrival of Block Themes which contain as little PHP as
 possible, it becomes necessary to add a few more hooks on the management
 of comments, to allow Gutenberg to define the settings that will apply by
 default on the themes.

 I propose to add a new `comments_closed_message` filter so themes and/or
 Gutenberg can opt-in/out displaying this message (and even edit the
 message itself), depending on the post type (enabled on Posts but disabled
 on Pages, for example).

 Related discussion/PR on Twenty Twenty-Two repository:
 https://github.com/WordPress/twentytwentytwo/pull/127

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


More information about the wp-trac mailing list