Skip to content

Commit

Permalink
Guard against autoloading outside WP
Browse files Browse the repository at this point in the history
  • Loading branch information
rmccue committed Apr 29, 2019
1 parent 4cdcb1b commit b572ac2
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 b572ac2

Please sign in to comment.