Make WordPress Core

Opened 13 years ago

Closed 10 years ago

#19858 closed defect (bug) (duplicate)

Close comments on attached images

Reported by: dohman's profile 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 13 years ago.
19858.2.diff (1.5 KB) - added by Mamaduka 12 years ago.

Download all attachments as: .zip

Change History (17)

#1 @nacin
13 years ago

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

Caused by #16090.

@nacin
13 years ago

#2 follow-up: @nacin
13 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.

#3 in reply to: ↑ 2 @westi
13 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

#5 @CoenJacobs
12 years ago

  • Cc coenjacobs@… added

#6 @nacin
12 years ago

  • Keywords needs-patch added

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

#7 @nacin
12 years ago

  • Milestone changed from 3.4 to Future Release

#8 @Mamaduka
12 years ago

  • Cc georgemamadashvili@… added

@Mamaduka
12 years ago

#9 @Mamaduka
12 years ago

Attached patch with inherit-ness check.

#10 @Mamaduka
12 years ago

  • Keywords has-patch added; needs-patch removed

#11 follow-up: @wlindley
12 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.

#12 in reply to: ↑ 11 @helenyhou
12 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

#13 @ocean90
11 years 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.

#14 @SergeyBiryukov
11 years ago

This sounds like a duplicate of #8177 to me.

#15 @wonderboymusic
10 years 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.