Skip to content

Commit bb68c50

Browse files
committed
add Backwards compatibility for old data-cc="c-settings" to new data-cc="show-preferencesModal
1 parent 2683cdd commit bb68c50

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

script-injection.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ function checkIframeConsent() {
129129
<?php // Run the Cookie Consent at last. ?>
130130
CookieConsent.run( airCookieSettings );
131131

132+
133+
<?php // Backwards compatibility for old data-cc="c-settings" to new data-cc="show-preferencesModal" ?>
134+
var oldSettingsLinks = document.querySelectorAll('[data-cc="c-settings"]');
135+
for (var i = 0; i < oldSettingsLinks.length; i++) {
136+
oldSettingsLinks[i].setAttribute('data-cc', 'show-preferencesModal');
137+
}
138+
132139
<?php // Backwards compatibility for cc.loadScript API ?>
133140
if ( typeof window.cc === 'undefined' ) {
134141
window.cc = {

0 commit comments

Comments
 (0)