cron-command
cron-command copied to clipboard
`wp cron event list` should show the actions for each event
I just updated WP-Crontrol so it also shows the actions attached to each cron event. WP-CLI should do the same when you use wp cron event list.
FYI - wp cron event list now lives in https://github.com/wp-cli/cron-command
Also, wp profile has a get_name_location_from_callback that might be useful to abstract to WP_CLI\Utils: https://github.com/wp-cli/profile-command/blob/master/inc/class-profiler.php#L469
Neat. Query Monitor has a pretty well battle-tested one too: https://github.com/johnbillion/query-monitor/blob/9b604e8972b09dad9ba17df84af5770118068fb6/classes/Util.php#L171-L252
I realize this is a runcommand thing, but is it not the same as
wp hook the-cron-event-name
e.g.
wp cron event list
+---------------------+---------------------+-------------------+------------+
| hook | next_run_gmt | next_run_relative | recurrence |
+---------------------+---------------------+-------------------+------------+
| wp_version_check | 2017-02-25 21:55:38 | now | 12 hours |
| wp_update_plugins | 2017-02-25 21:55:38 | now | 12 hours |
| wp_update_themes | 2017-02-25 21:55:38 | now | 12 hours |
| wp_scheduled_delete | 2017-02-25 21:57:15 | now | 1 day |
+---------------------+---------------------+-------------------+------------+
wp hook wp_version_check
+--------------------+---------------------------+----------+---------------+
| callback | location | priority | accepted_args |
+--------------------+---------------------------+----------+---------------+
| wp_version_check() | wp-includes/update.php:24 | 10 | 1 |
+--------------------+---------------------------+----------+---------------+
@johnbillion are you suggesting a kind of combined table for combining the output of wp hook for each cron in the list?
Yep!
Could/should this be solved with documentation instead?
Use
wp hook <hook>to inspect the callbacks on each event.
Watch out for situations where one hook is scheduled 2000 times. The output in that circumstance probably needs to be truncated / sanitized.