From b572ac232a24bddca6ecdb668129bab347ab098b Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Mon, 29 Apr 2019 13:20:06 +0100 Subject: [PATCH] Guard against autoloading outside WP --- load.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/load.php b/load.php index b4ea5b1..0d533c4 100644 --- a/load.php +++ b/load.php @@ -7,6 +7,11 @@ require_once __DIR__ . '/inc/namespace.php'; +// Don't self-initialize if this is not a Platform execution. +if ( ! function_exists( 'add_action' ) ) { + return; +} + add_action( 'hm-platform.modules.init', function () { $default_settings = [ 'enabled' => in_array( get_environment_architecture(), [ 'chassis', 'local-server' ] ),