You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've created a custom plugin which archivates a post and creates a redirect when the events in the post are outdated. The plugin function is triggered by wp-cron.php requests. I'm using the PHP API of Redirection.
Currently I've added a hack to load the admin branch and disable the frontend branch of Redirection using action 'plugins_loaded' in case wp_doing_cron() is true.
In plugin Redirection the branches are loaded around line 87 in the initial file redirection.php: if ( red_is_admin() || red_is_wpcli() ) {
require_once DIR . '/redirection-admin.php';
require_once DIR . '/api/api.php';
} else {
require_once DIR . '/redirection-front.php';
}
Is it possible to add the check for wp_doing_cron() in this sequence, too? It would than look like: if ( red_is_admin() || red_is_wpcli() || wp_doing_cron() ) {
require_once DIR . '/redirection-admin.php';
require_once DIR . '/api/api.php';
} else {
require_once DIR . '/redirection-front.php';
}
The text was updated successfully, but these errors were encountered:
I've created a custom plugin which archivates a post and creates a redirect when the events in the post are outdated. The plugin function is triggered by wp-cron.php requests. I'm using the PHP API of Redirection.
Currently I've added a hack to load the admin branch and disable the frontend branch of Redirection using action 'plugins_loaded' in case wp_doing_cron() is true.
In plugin Redirection the branches are loaded around line 87 in the initial file redirection.php:
if ( red_is_admin() || red_is_wpcli() ) {
require_once DIR . '/redirection-admin.php';
require_once DIR . '/api/api.php';
} else {
require_once DIR . '/redirection-front.php';
}
Is it possible to add the check for wp_doing_cron() in this sequence, too? It would than look like:
if ( red_is_admin() || red_is_wpcli() || wp_doing_cron() ) {
require_once DIR . '/redirection-admin.php';
require_once DIR . '/api/api.php';
} else {
require_once DIR . '/redirection-front.php';
}
The text was updated successfully, but these errors were encountered: