Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making sure WordPress Cron runs #105

Closed
szepeviktor opened this issue Sep 7, 2023 · 1 comment
Closed

Making sure WordPress Cron runs #105

szepeviktor opened this issue Sep 7, 2023 · 1 comment

Comments

@szepeviktor
Copy link
Contributor

szepeviktor commented Sep 7, 2023

I've found no way in core to look up when WordPress Cron ran the last time.

<?php

add_filter(
    'pre_set_transient_doing_cron',
    static function ($value) {
        update_option('cron_last_run', $value, 'no');
        return $value;
    },
    0,
    1
);

This MU plugin records the time of last run in an option called cron_last_run.

Then it can be compared to current time: wp option get cron_last_run

(I use Linux cron jobs to run WordPress Cron)

@johnbillion
Copy link
Owner

Thanks! Closing in favour of #19 which I'll get to... one day...

@johnbillion johnbillion closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants