Skip to content

Commit

Permalink
Merge pull request #5 from humanmade/exists-guard
Browse files Browse the repository at this point in the history
Guard against autoloading outside WP
  • Loading branch information
rmccue authored Apr 29, 2019
2 parents 5318837 + b572ac2 commit 0664c90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions load.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ] ),
Expand Down

0 comments on commit 0664c90

Please sign in to comment.