Skip to content

Commit

Permalink
Fix Cookiebot disabled in WP admin feature
Browse files Browse the repository at this point in the history
  • Loading branch information
phpgeek committed Sep 24, 2019
1 parent 51a5f18 commit 147f4dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions addons/controller/plugin-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public function load_active_addons() {
return;
}

if( \Cookiebot_WP::cookiebot_disabled_in_admin() === true && is_admin() ) {
return;
}

/**
* Check plugins one by one and load configuration if it is active
*
Expand Down
1 change: 0 additions & 1 deletion addons/cookiebot-addons-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public function __construct() {
new Plugin_Controller( $this->container->get( 'Settings_Service_Interface' ) ),
'load_active_addons',
) );

/**
* Load settings config
*
Expand Down
6 changes: 2 additions & 4 deletions cookiebot.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ function cookiebot_init() {
//Make sure we got a PHP version that works
if(version_compare(PHP_VERSION, '5.4.0', '>=')) {
define('COOKIEBOT_URL', plugin_dir_url( __FILE__ ));
if(!is_admin() || !$this->cookiebot_disabled_in_admin()) {
include_once( dirname( __FILE__ ) . '/addons/cookiebot-addons-init.php' );
}
include_once( dirname( __FILE__ ) . '/addons/cookiebot-addons-init.php' );
}
else {
define('COOKIEBOT_ADDONS_UNSUPPORTED_PHPVERSION',true);
Expand Down Expand Up @@ -696,7 +694,7 @@ function settings_page() {
?>
<p class="description">
<?php if($disabled) { echo '<b>'._('Network setting applied. Please contact website administrator to change this setting.').'</b><br />'; } ?>
<b><?php _e('This checkbox will remove the cookie consent banner the Wordpress Admin area.','cookiebot') ?></b>
<b><?php _e('This checkbox will disable Cookiebot in the Wordpress Admin area.','cookiebot') ?></b>
</p>
</td>
</tr>
Expand Down

0 comments on commit 147f4dd

Please sign in to comment.