Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 8 years ago

#20433 closed defect (bug) (fixed)

Don't update last_updated when deleting non-published posts

Reported by: ryan's profile ryan Owned by: ryan's profile ryan
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: Multisite Keywords: has-patch
Focuses: Cc:

Description

add_action( 'delete_post', 'wpmu_update_blogs_date' );

Instead of that, let's hook in an action that checks the post status and updates only when published posts are deleted. This will avoid lots of updates to wp_blogs when cleaning out old auto-draft posts.

Inspired by #19663. [20440] caused massive numbers of updates to wp_blogs.

Attachments (2)

20433.patch (644 bytes) - added by SergeyBiryukov 13 years ago.
20433.2.patch (1.4 KB) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (10)

#1 @ryan
13 years ago

  • Summary changed from Don't update last_updated when deleting nn-published posts to Don't update last_updated when deleting non-published posts

#2 @nacin
13 years ago

We can probably re-purpose what went in for [19129].

#3 @SergeyBiryukov
13 years ago

  • Keywords has-patch added

Just removing the action seems enough. _update_blog_date_on_post_publish() handles the rest.

#4 @azaozz
13 years ago

Perhaps also bypass it when deleting trashed posts. Form the user's point of view they are long gone and nothing has changed.

#5 @ryan
13 years ago

Just removing the action will work fine for trashed posted that are later deleted as_update_blog_date_on_post_publish() will indeed handle things. But, it won't work for forced deletions. We don't care about the auto-draft forced deletions, but are there forced deletes we should care about?

#6 @SergeyBiryukov
13 years ago

20433.2.patch introduces _update_blog_date_on_post_delete().

#7 @ryan
13 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [20461]:

Don't update a blog's last_updated time for all post deletions. Update only when published posts are deleted.

Props SergeyBiryukov
fixes #20433

This ticket was mentioned in Slack in #core-multisite by jjj. View the logs.


8 years ago

Note: See TracTickets for help on using tickets.