Skip to content

Instantly share code, notes, and snippets.

View tonai126's full-sized avatar

Antonio Candela tonai126

View GitHub Profile
@tonai126
tonai126 / disable_cmplz_cron.php
Created February 19, 2026 10:30
Disables the cmplz_every_five_minutes_hook cron job
<?php
/**
* Plugin Name: Disable Complianz Cron
* Description: Disables the cmplz_every_five_minutes_hook cron job
*/
// Remove the already scheduled event
add_action('init', function() {
wp_clear_scheduled_hook('cmplz_every_five_minutes_hook');
});
<?php
/**
* Add a custom point 8 to the Privacy Statement
* Remove line 1 if implemented in functions.php instead of an mu-plugin
*/
function cmplz_edit_privacy_document_html($html, $region, $post_id) {
// Only modify the Privacy Statement EU (not Cookie Policy) ------- PLEASE INSERT THE SLUG OF THE PRIVACY STATEMENT PAGE
$post = get_post($post_id);
if (!$post || $post->post_name !== 'privacy-statement-eu') {
return $html;
@tonai126
tonai126 / new_point.php
Created December 5, 2025 08:44
Add a new item to the Cookie Policy and renumber the subsequent ones. (lang it_IT)
<?php
/**
* Add a custom point 8 to the Cookie Policy
* Remove line 1 if implemented in functions.php instead of an mu-plugin
*/
function cmplz_edit_document_html($html) {
// Your new point 8
$punto_8 = '
<h2>8. Titolo del tuo punto personalizzato</h2>
<p>Qui inserisci il testo del tuo punto 8. Scrivi tutte le informazioni che vuoi aggiungere alla tua cookie policy.</p>
<?php
function disable_obfuscate_email() {
remove_all_filters( 'cmplz_document_email' );
add_filter( 'cmplz_document_email', function( $email ) {
return $email;
}, 10, 1 );
}
add_action( 'init', 'disable_obfuscate_email', 99 );
<?php
function cmplz_add_social_media_category($html){
$pattern = '/<details class="cmplz-category cmplz-marketing.*?<\/details>/is';
ob_start();
?>
<details class="cmplz-category cmplz-socialmedia">
<summary>
<span class="cmplz-category-header">
<span class="cmplz-category-title"><?php _e("Social media", "complianz-gdpr")?></span>
<span class="cmplz-banner-checkbox">
<?php
defined( 'ABSPATH' ) or die( "you do not have access to this page!" );
/**
* Add custom css to banner css file
* @return void
*/
function add_my_custom_banner_css() {
// Wait for DOM to be ready
document.addEventListener('DOMContentLoaded', function() {
// Select the privacy statement link
const privacystatementLink = document.querySelector('.cmplz-documents.cmplz-links .cmplz-link.privacy-statement');
// Check if the privacy statement link exists
if (privacystatementLink) {
// Change the text only if it matches "Privacy Statement"
if (privacystatementLink.textContent.trim() === 'Privacy Statement') {
privacystatementLink.textContent = 'privacy';
<?php
/**
* Ultimate Maps Integration for Complianz GDPR
*/
defined( 'ABSPATH' ) || die( 'You do not have access to this page!' );
/**
* Register Ultimate Maps scripts with Complianz.
*
@tonai126
tonai126 / cmplz-links-new_tab.js
Created October 10, 2025 15:25
opens the cmplz-links in a new tab
<script>
// Wait for DOM to be ready
document.addEventListener('DOMContentLoaded', function() {
const privacystatementLink = document.querySelector('.cmplz-documents.cmplz-links .cmplz-link.privacy-statement');
if (privacystatementLink) {
privacystatementLink.textContent = 'your_text'; // Change the text inside the link
}
const cookiestatementLink = document.querySelector('.cmplz-documents.cmplz-links .cmplz-link.cookie-statement');