[wp-trac] [WordPress Trac] #55894: Where is the "wp_update_user_counts" action defined?
WordPress Trac
noreply at wordpress.org
Thu Jun 2 13:58:23 UTC 2022
#55894: Where is the "wp_update_user_counts" action defined?
--------------------------+------------------------------
Reporter: tmatsuur | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Users | Version: 6.0
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by SergeyBiryukov):
Hi there, thanks for the ticket!
Replying to [ticket:55894 tmatsuur]:
> {{{
> add_action( 'wp_update_user_counts', 'wp_schedule_update_user_counts',
10, 0 );
> }}}
>
> The "wp_update_user_counts" function never calls the do_action function,
and I do not know where the above callback function is called.
It looks like the `wp_update_user_counts` action is scheduled via
`wp_schedule_event()` in [source:tags/6.0/src/wp-
includes/user.php?marks=1411#L1400 wp_schedule_update_user_counts()] and
then executed via `call_user_func()` in [source:tags/6.0/src/wp-
includes/cron.php?marks=1001#L994 _wp_cron()].
As far as I can tell, this is consistent with how other cron tasks run,
e.g. `wp_scheduled_auto_draft_delete`, and does not require a
`do_action()` call.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55894#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list