From 2e7d9a758e3f7b554574b8b7d2e6962f1437a88f Mon Sep 17 00:00:00 2001 From: Erin Kosewic Date: Sat, 12 Nov 2016 11:50:04 -0800 Subject: [PATCH] adding WP CLI check in case attempting to deactivate --- lib/fewbricks.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/fewbricks.php b/lib/fewbricks.php index b9e1778..1be00d8 100644 --- a/lib/fewbricks.php +++ b/lib/fewbricks.php @@ -47,7 +47,16 @@ public static function construct() } - } else { + } else if ( defined( 'WP_CLI' ) && WP_CLI ) { + //added in case something goes wrong and we need to deactivate the plugin from WP CLI! + if( self::acf_exists() && + self::fewbricks_hidden_exists() && + self::fewbricks_template_dir_exists()) + { + self::add_fewbricks_hidden_activated_check(); + self::init(); + } + } else { // Not in admin system, so assume that all is good. self::init(); @@ -351,4 +360,4 @@ private static function init_messages() } -} \ No newline at end of file +}