If the ALTERNATE_WP_CRON constant is defined on a site, any CLI command can potentially fail due to the cron spawner attempting a redirect (which gets caught by WP_CLI\Utils\wp_redirect_handler()).
WP-CLI can avoid this with the following:
if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) {
remove_action( 'init', 'wp_cron' );
}
Not sure where best to place this, and also I'm wondering whether WordPress core should add some extra logic to this condition so it doesn't attempt a redirect on the CLI.
Thoughts?
If the
ALTERNATE_WP_CRONconstant is defined on a site, any CLI command can potentially fail due to the cron spawner attempting a redirect (which gets caught byWP_CLI\Utils\wp_redirect_handler()).WP-CLI can avoid this with the following:
Not sure where best to place this, and also I'm wondering whether WordPress core should add some extra logic to this condition so it doesn't attempt a redirect on the CLI.
Thoughts?