WordPress.org

Make WordPress Core

Changeset 52207


Ignore:
Timestamp:
11/18/2021 03:10:18 PM (3 weeks ago)
Author:
audrasjb
Message:

Posts, Post Types: Multisite: Decrement post_count option value when a post is deleted.

Previously, the post_count option value was not decremented when a post was deleted.

This change moves the _update_posts_count_on_delete action from delete_post hook to after_delete_post to ensure the deletion is taken into account.

Props henry.wright, pbearne, audrasjb.
Fixes #53443.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-default-filters.php

    r48315 r52207  
    7777// Administration.
    7878add_filter( 'term_id_filter', 'global_terms', 10, 2 );
    79 add_action( 'delete_post', '_update_posts_count_on_delete' );
     79add_action( 'after_delete_post', '_update_posts_count_on_delete' );
    8080add_action( 'delete_post', '_update_blog_date_on_post_delete' );
    8181add_action( 'transition_post_status', '_update_blog_date_on_post_publish', 10, 3 );
Note: See TracChangeset for help on using the changeset viewer.