-
Notifications
You must be signed in to change notification settings - Fork 13
/
manage-consent-button.php
50 lines (43 loc) · 1.34 KB
/
manage-consent-button.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
defined( 'ABSPATH' ) or die( "you do not have acces to this page!" );
/**
* 1. Make sure you use the Font-Awesome 5 Library. A free plugin with the same name is available for download.
* 2. Do NOT hide the current Manage Consent Tab under settings.
* 3. Change CSS if so desired!
*/
function myCustomManageConsent() {
?>
<div id="manageconsent" class="cmplz-show-banner"><i class="cmplz-fas fas fa-cookie-bite"></i></div>
<style>
#manageconsent {
font-family: "Font Awesome Free 5";
position: fixed;
cursor: pointer;
width: 60px;
height: 60px;
bottom: 40px;
left: 40px;
font-size: 30px;
background-color: #29b6f6;
color: #fff;
line-height: 2;
border-radius: 50px;
text-align: center;
box-shadow: 2px 2px 3px #999;
}
#manageconsent:hover {
background-color: #333;
color: #fff;
}
.cmplz-manage-consent {display:none;}
</style>
<script>
document.addEventListener('click', '.cmplz-show-banner', function(){
document.querySelectorAll('.cmplz-manage-consent').forEach(obj => {
obj.click();
});
});
</script>
<?php
}
add_action( 'wp_footer', 'myCustomManageConsent' );