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

Props SergeyBiryukov
fixes #20433


git-svn-id: https://develop.svn.wordpress.org/trunk@20461 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-04-13 17:30:37 +00:00
parent acfa043b2a
commit 8caae7f602
2 changed files with 22 additions and 1 deletions
+21
View File
@@ -710,3 +710,24 @@ function _update_blog_date_on_post_publish( $new_status, $old_status, $post ) {
wpmu_update_blogs_date();
}
/**
* Handler for updating the blog date when a published post is deleted.
*
* @since 3.4.0
*
* @param int $post_id Post ID
*/
function _update_blog_date_on_post_delete( $post_id ) {
$post = get_post( $post_id );
$post_type_obj = get_post_type_object( $post->post_type );
if ( ! $post_type_obj->public )
return;
if ( 'publish' != $post->post_status )
return;
wpmu_update_blogs_date();
}