[wp-trac] [WordPress Trac] #28080: Commenting possible on custom post type after support for commenting removed from CPT.

WordPress Trac noreply at wordpress.org
Sun Jan 25 19:35:40 UTC 2015


#28080: Commenting possible on custom post type after support for commenting
removed from CPT.
--------------------------+------------------------------
 Reporter:  Shelob9       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Comments      |     Version:  3.9
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by couturefreak):

 I was able to reproduce this.

 Simply removing custom post type support for comments does not mean that
 comments are disabled for a post. I believe that is the correct logic. In
 some cases, an admin may want to keep the existing comments on those
 posts, even if comments are eventually disabled for the entire post type (
 or if they use a plugin to convert the post type to another post type ) .

 Currently: Post comment meta boxes ( discussion and comments ) are only
 visible based on the check for `post_type_supports()` for comments.

 The patch above adds a check for `comments_open()` or `pings_open()` to
 show the discussion meta box.
 And adds an additional check for `comment_count > 0` to show the comments
 meta box.

 So, if a post has comments or pings enabled, the admin will still be able
 to disable comments / pings using the `post_comment_status_meta_box()`,
 and moderate existing comments on the post using the
 `post_comment_meta_box()`, even if the post type no longer supports
 comments.

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


More information about the wp-trac mailing list