From 4b322d9de3b95c0ca289e06d028a757713cfb50a Mon Sep 17 00:00:00 2001 From: audrasjb Date: Thu, 18 Nov 2021 15:11:59 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@52207 git-svn-id: http://core.svn.wordpress.org/trunk@51799 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-default-filters.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/ms-default-filters.php b/wp-includes/ms-default-filters.php index 042751e491..1b32f7a32b 100644 --- a/wp-includes/ms-default-filters.php +++ b/wp-includes/ms-default-filters.php @@ -76,7 +76,7 @@ add_filter( 'allowed_redirect_hosts', 'redirect_this_site' ); // Administration. add_filter( 'term_id_filter', 'global_terms', 10, 2 ); -add_action( 'delete_post', '_update_posts_count_on_delete' ); +add_action( 'after_delete_post', '_update_posts_count_on_delete' ); add_action( 'delete_post', '_update_blog_date_on_post_delete' ); add_action( 'transition_post_status', '_update_blog_date_on_post_publish', 10, 3 ); add_action( 'transition_post_status', '_update_posts_count_on_transition_post_status', 10, 3 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index ac2347473e..2870b6a33a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-52206'; +$wp_version = '5.9-alpha-52207'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.