WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 10 months ago

#19858 closed defect (bug) (duplicate)

Close comments on attached images

Reported by: dohman Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2
Component: Media Keywords: has-patch close
Focuses: Cc:

Description

In posts, for gallery images and individual images which open in an attachment page when clicked, the image attachment page does not close comments after the designated xx days as the original post does.

This creates a pile of spam to manage for users that rely on closed comments after xx days and post lots of images.

You can replicate the problem with these steps:
1) In Discussion Settings: set comments to close after 1 day. 'Automatically close comments on articles older than 1 days'

2)Create a post with publish date 2 days ago. Insert an image or gallery which opens in in an attachment page, not just as the image file.

3) The post will have comments closed.

4) The image attachment page will still have comments open.

Here's a test post of mine. Notice the comments closed on the post but still open for the images.
http://hackhappy.wordpress.com/2012/01/17/image-attachment-comment-test/

Bottom Line: Comments should also close after xx days for image attachments, just as the post does. Users reasonably expect this.

Check the post type for image attachment page. It may be marked as a regular page as pages are not controlled by this setting.

Attachments (2)

19858.diff (896 bytes) - added by nacin 4 years ago.
19858.2.diff (1.5 KB) - added by Mamaduka 3 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 @nacin4 years ago

  • Milestone changed from Awaiting Review to 3.4
  • Version set to 3.2

Caused by #16090.

@nacin4 years ago

comment:2 follow-up: @nacin4 years ago

19858.diff simply adds 'attachment' to the array of post types to be closed. It's kind of weak — we should probably check the parent of the attachment to ensure it is either 0 or a post type of 'post' (the filter result) before continuing.

comment:3 in reply to: ↑ 2 @westi4 years ago

Replying to nacin:

19858.diff simply adds 'attachment' to the array of post types to be closed. It's kind of weak — we should probably check the parent of the attachment to ensure it is either 0 or a post type of 'post' (the filter result) before continuing.

Maybe we should be using the status of inherit to mean we look at the parent in this filter instead?

So if post-status is inherit we look at the parent's post type and date

comment:5 @CoenJacobs3 years ago

  • Cc coenjacobs@… added

comment:6 @nacin3 years ago

  • Keywords needs-patch added

get_post_status() could be used here to check inherit-ness. Needs patch.

comment:7 @nacin3 years ago

  • Milestone changed from 3.4 to Future Release

comment:8 @Mamaduka3 years ago

  • Cc georgemamadashvili@… added

@Mamaduka3 years ago

comment:9 @Mamaduka3 years ago

Attached patch with inherit-ness check.

comment:10 @Mamaduka3 years ago

  • Keywords has-patch added; needs-patch removed

comment:11 follow-up: @wlindley3 years ago

The Settings > Discussion menu should have another checkbox, "Allow people to post comments on new attachments." The "attachment pages" are quite well hidden from most viewers and admins, and on most sites they are accessible only to spambots. Attachment comments thus should be globally disallowable even if a site permits posts to have comments.

comment:12 in reply to: ↑ 11 @helenyhou3 years ago

Replying to wlindley:

The Settings > Discussion menu should have another checkbox, "Allow people to post comments on new attachments."

I don't think another option is needed here, and I think this ticket is about automatically closing comments after X days. Also related to your idea, and may very well take care of it: #21391

comment:13 @ocean9018 months ago

  • Keywords close added

For the same reason as in comment ticket:8177:33 attachment posts shouldn't be auto closed by default.

You can easily adjust this by the close_comments_for_post_types filter.

Replying to wlindley:

The Settings > Discussion menu should have another checkbox,…

See #12991.

comment:14 @SergeyBiryukov18 months ago

This sounds like a duplicate of #8177 to me.

comment:15 @wonderboymusic10 months ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #8177.

Note: See TracTickets for help on using tickets.