Skip to content

Commit

Permalink
Issue #133: Adjust logic in _gin_is_active().
Browse files Browse the repository at this point in the history
Fixes #133.
By @laryn and @stpaultim.
  • Loading branch information
laryn authored May 13, 2024
1 parent 24273da commit d374377
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions includes/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@ function _gin_toolbar_radios($element) {
}

/**
* Helper function for check if Gin is active.
* Helper function for checking if Gin is active. In this case, active means
* that Gin is set as the default admin theme or is the currently active theme.
*/
function _gin_is_active() {
$admin_theme = config_get('system.core', 'admin_theme');

// Check if set as admin theme.
if ($admin_theme === 'gin') {
return true;
}
$admin_theme = config_get('system.core', 'admin_theme');

return false;
return ($admin_theme === 'gin' || $GLOBALS['theme_key'] === 'gin');
}

0 comments on commit d374377

Please sign in to comment.