Skip to content

Commit 42071dd

Browse files
committed
The wp_update_user_counts hook is not persistent on a Multisite installation.
1 parent 525d7e0 commit 42071dd

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

src/bootstrap.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,7 +2564,7 @@ function filter_removable_query_args( array $args ) {
25642564
* @return array<int,string> Array of hook names.
25652565
*/
25662566
function get_persistent_core_hooks() {
2567-
return array(
2567+
$hooks = array(
25682568
'wp_update_plugins', // 2.7.0
25692569
'wp_update_themes', // 2.7.0
25702570
'wp_version_check', // 2.7.0
@@ -2576,8 +2576,13 @@ function get_persistent_core_hooks() {
25762576
'recovery_mode_clean_expired_keys', // 5.2.0
25772577
'wp_site_health_scheduled_check', // 5.4.0
25782578
'wp_https_detection', // 5.7.0
2579-
'wp_update_user_counts', // 6.0.0
25802579
);
2580+
2581+
if ( ! is_multisite() ) {
2582+
$hooks[] = 'wp_update_user_counts'; // 6.0.0
2583+
}
2584+
2585+
return $hooks;
25812586
}
25822587

25832588
/**
@@ -2586,7 +2591,7 @@ function get_persistent_core_hooks() {
25862591
* @return array<int,string> Array of hook names.
25872592
*/
25882593
function get_all_core_hooks() {
2589-
return array_merge(
2594+
$hooks = array_merge(
25902595
get_persistent_core_hooks(),
25912596
array(
25922597
'do_pings', // 2.1.0
@@ -2599,6 +2604,12 @@ function get_all_core_hooks() {
25992604
'wp_delete_temp_updater_backups', // 6.3.0
26002605
)
26012606
);
2607+
2608+
if ( is_multisite() ) {
2609+
$hooks[] = 'wp_update_user_counts'; // 6.0.0
2610+
}
2611+
2612+
return $hooks;
26022613
}
26032614

26042615
/**

0 commit comments

Comments
 (0)