Skip to content

Commit

Permalink
feat: add condition param for consentOptout()
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Aug 29, 2023
1 parent 00ef357 commit 9a31a96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,9 @@ public function consent($name, $enabled, $disabled = null)
return $this->html($enabled . $disabled);
}

public function consentOptout($name, $script)
public function consentOptout($name, $script, $condition = true)
{
if (!$condition) return;
$enabled = str_replace(" src=", " rfconsent='$name' rfconsent-type=optout rfconsent-src=", $script);
return $this->html($enabled);
}
Expand Down

0 comments on commit 9a31a96

Please sign in to comment.