From f7c9097facdfecd6d7be205b1ba47e5595371435 Mon Sep 17 00:00:00 2001 From: Erick Hitter <git-contrib@ethitter.com> Date: Thu, 7 Sep 2017 15:10:44 -0700 Subject: [PATCH] Further scaffolding --- includes/run.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/includes/run.php b/includes/run.php index 28b4476..db46dc7 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' ); -- GitLab