--- a/wp/wp-includes/ms-default-filters.php Wed Sep 21 18:19:35 2022 +0200
+++ b/wp/wp-includes/ms-default-filters.php Tue Sep 27 16:37:53 2022 +0200
@@ -76,7 +76,7 @@
// 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 );
@@ -84,9 +84,14 @@
// Counts.
add_action( 'admin_init', 'wp_schedule_update_network_counts' );
add_action( 'update_network_counts', 'wp_update_network_counts', 10, 0 );
-foreach ( array( 'user_register', 'deleted_user', 'wpmu_new_user', 'make_spam_user', 'make_ham_user' ) as $action ) {
+foreach ( array( 'wpmu_new_user', 'make_spam_user', 'make_ham_user' ) as $action ) {
add_action( $action, 'wp_maybe_update_network_user_counts', 10, 0 );
}
+
+// These counts are handled by wp_update_network_counts() on Multisite:
+remove_action( 'admin_init', 'wp_schedule_update_user_counts' );
+remove_action( 'wp_update_user_counts', 'wp_schedule_update_user_counts' );
+
foreach ( array( 'make_spam_blog', 'make_ham_blog', 'archive_blog', 'unarchive_blog', 'make_delete_blog', 'make_undelete_blog' ) as $action ) {
add_action( $action, 'wp_maybe_update_network_site_counts', 10, 0 );
}