diff --git a/includes/run.php b/includes/run.php index 28b4476b25988ca66ddb114d4846e93bdf53e6ee..db46dc7223105717ca14e2e073ad53b5a5cff431 100644 --- a/includes/run.php +++ b/includes/run.php @@ -2,16 +2,15 @@ namespace Automattic\WP\WP_CLI_Cron_Control_Offload; -if ( ! defined( 'WP_CLI' ) || ! \WP_CLI ) { - return; -} - -use WP_CLI; - /** * */ function run_event( $args ) { - return false; + if ( ! defined( 'WP_CLI' ) || ! \WP_CLI ) { + trigger_error( 'Attempted to run event without WP-CLI loaded. ' . compact( $args ), E_USER_WARNING ); + return false; + } + + // TODO: run event, sending output to error log } add_action( ACTION, __NAMESPACE__ . '\run_event' );