Skip to content

Commit aec6c55

Browse files
authored
Welcome: Only count internal callbacks as steps (#1942)
1 parent 2ee2e82 commit aec6c55

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: changed
3+
4+
Step counts for the Welcome checklist now only take into account steps that are added in the Welcome class.

includes/wp-admin/class-welcome-fields.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ private static function get_total_steps_count() {
139139
$count = 0;
140140

141141
if ( isset( $wp_filter['activitypub_onboarding_steps'] ) ) {
142-
$count = \count( $wp_filter['activitypub_onboarding_steps']->callbacks );
142+
$pattern = '/^' . \preg_quote( self::class, '/' ) . '/';
143+
foreach ( $wp_filter['activitypub_onboarding_steps']->callbacks as $callbacks ) {
144+
$matching_keys = \preg_grep( $pattern, \array_keys( $callbacks ) );
145+
$count += \count( $matching_keys );
146+
}
143147
}
144148

145149
return $count;

0 commit comments

Comments
 (0)