Skip to content

Commit

Permalink
Fix wp-graphql activation check
Browse files Browse the repository at this point in the history
  • Loading branch information
esamattis committed Jan 27, 2020
1 parent 7a49140 commit f14f0e4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ class Loader
private $pll_context_called = false;

static function init() {
// Bail out early if WPGraphQL is not activated.
if (!class_exists('WPGraphQL')) {
return;
};

define('WPGRAPHQL_POLYLANG', true);
(new Loader())->bind_hooks();
}
Expand Down Expand Up @@ -102,6 +97,11 @@ function endsWith($haystack, $needle)

function is_graphql_request()
{
// Detect WPGraphQL activation by checking if the main class is defined
if (!class_exists('WPGraphQL')) {
return false;
};

if (!defined('POLYLANG_VERSION')) {
return false;
}
Expand Down

0 comments on commit f14f0e4

Please sign in to comment.