Skip to content
Snippets Groups Projects
Commit 6bd692d7 authored by ale's avatar ale
Browse files

Set wp "cron mode" when running cron jobs

parent 9687ad74
No related branches found
No related tags found
No related merge requests found
......@@ -256,6 +256,7 @@ function do_upgrade($args) {
// 'run-cron': Run cron jobs.
function do_run_cron($args) {
add_filter('wp_doing_cron', function($args) { return true; });
foreach ($args as $arg) {
$blog = noblogs_get_blog($arg);
if (!$blog) {
......@@ -267,6 +268,7 @@ function do_run_cron($args) {
echo "{$arg}: ok\n";
restore_current_blog();
}
remove_all_filters('wp_doing_cron');
}
function do_check_spam($args) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment