diff --git a/system/src/Grav/Common/Plugin.php b/system/src/Grav/Common/Plugin.php index 495d1da1a..99c7411a0 100644 --- a/system/src/Grav/Common/Plugin.php +++ b/system/src/Grav/Common/Plugin.php @@ -101,11 +101,7 @@ public function config() */ public function isAdmin() { - if (isset($this->grav['admin'])) { - return true; - } - - return false; + return Utils::isAdminPlugin(); } /** diff --git a/system/src/Grav/Common/Utils.php b/system/src/Grav/Common/Utils.php index 6f69480b6..4aad66f9d 100644 --- a/system/src/Grav/Common/Utils.php +++ b/system/src/Grav/Common/Utils.php @@ -622,4 +622,18 @@ public static function verifyNonce($nonce, $action) //Invalid nonce return false; } + + /** + * Simple helper method to get whether or not the admin plugin is active + * + * @return bool + */ + public static function isAdminPlugin() + { + if (isset(Grav::instance()['admin'])) { + return true; + } + + return false; + } }