Skip to content

Instantly share code, notes, and snippets.

View AertHulsebos's full-sized avatar

Aert Hulsebos AertHulsebos

View GitHub Profile
<?php
defined( 'ABSPATH' ) or die( "you do not have access to this page!" );
/**
* Conditional notices for fields
*
* @param array $notices
*
* @return array
*/
/**
** 3. Title only
*/
@media (max-width: 425px) {
.cmplz-cookiebanner
.cmplz-header
.cmplz-title {
display: block;
}
/**
** 2. Title and Logo
*/
@media (max-width: 425px) {
.cmplz-cookiebanner
.cmplz-header
.cmplz-title {
display: block;
}
/**
** 1. Title and Close Button
*/
@media (max-width: 425px) {
.cmplz-cookiebanner
.cmplz-header
.cmplz-title {
display: block;
}
<?php
/**
* For each activate consenttype a banner is created
* If A/B testing is enabled, each banner is rendered per consenttype as well.
*/
?>
<div class="cmplz-cookiebanner cmplz-hidden banner-{id} {consent_type} cmplz-{position} cmplz-categories-type-{use_categories}" aria-modal="true" data-nosnippet="true" role="dialog" aria-live="polite" aria-labelledby="cmplz-header-{id}-{consent_type}" aria-describedby="cmplz-message-{id}-{consent_type}">
<div class="cmplz-header">
<div class="cmplz-logo">{logo}</div>
<div class="cmplz-title" id="cmplz-header-{id}-{consent_type}">{header}</div>
<?php
/**
* Override cookiebanner template html
* @param string $html
*
* @return string
*/
function cmplz_custom_banner_file($path, $filename){
<?php
/*
** Remove line 1 when you're NOT using a MU plugin
** YouTube custom placeholder will replace all YouTube placeholders
*/
function cmplz_my_custom_youtube_placeholder($new_src, $src){
$new_src = 'https://mydomain.com/my-incredible-placeholder.jpg';
return $new_src;
<?php
/**
* For each activate consent type a banner is created
* If A/B testing is enabled, each banner is rendered per consenttype as well.
*/
?>
<!-- Header - Including Logo, Title, Close Icon -->
/**
* Override cookiebanner template html
* @param string $html
*
* @return string
*/
function cmplz_custom_banner_file($path, $filename){
if ($filename === 'cookiebanner.php' ) {
error_log("change path to ".trailingslashit(WPMU_PLUGIN_DIR).'cookiebanner/cookiebanner.php');
/**
* Completely override CSS generated by Complianz
* @param string $css
*
* @return string
*/
function my_custom_banner_css($css){
ob_start();
//add css below