[wp-trac] [WordPress Trac] #31168: Comments should be turned off on pages by default

WordPress Trac noreply at wordpress.org
Mon Jun 29 22:34:09 UTC 2015


#31168: Comments should be turned off on pages by default
-------------------------------------+---------------------------
 Reporter:  melchoyce                |       Owner:  valendesigns
     Type:  enhancement              |      Status:  assigned
 Priority:  normal                   |   Milestone:  4.3
Component:  Comments                 |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+---------------------------

Comment (by andg):

 Replying to [comment:30 valendesigns]:
 > @efegue the previous patch was a global deactivation of comment &
 trackback support for the `page` post type. What this patch does is set
 `comment_status` & `ping_status` to `closed`  for new pages and post types
 that do not support those features. From a UX standpoint you can still
 check the option to display comments and trackbacks on a new page, so you
 will not need a developer to get comments back.
 >
 > However, this patch does allow you to filter the default status for
 other post types. So a developer would be able to support comments and
 trackbacks in their custom post type, but have those features default to
 `closed` when a new post is created.
 >
 > From my point of view this change is a lot less destructive, or
 potentially confusing, to the user. As well, it give us more control as
 developers to make decisions about our custom post types and how they
 support comments and trackbacks. And finally, we could standardize the
 default values with these new functions in other parts of Core.

 +1

 I was wondering, looking at the patch you've submitted, wouldn't the
 `get_default_comment_status` and `get_default_ping_status` filters be more
 clear if they had a `$post_type` parameter, otherwise one would be forced
 to use a global variable (correct me if I'm wrong).

 Alternatively, the information about the post type being filtered could be
 included in the filter name itself, such as
 `get_default_comment_status_$post_type`.

 In any case, this is a good solution to a very common problem, so thanks.

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


More information about the wp-trac mailing list