Skip to content

Commit 794ed1c

Browse files
fix: gluonSetConsentType() only provides default 'optin', never overrides site value
Co-authored-by: MaximillianGroup <34328348+MaximillianGroup@users.noreply.github.com> Agent-Logs-Url: https://github.com/Starisian-Technologies/sparxstar-gluon/sessions/e9332144-f32f-49c4-9c54-a329381467dc
1 parent 8c2c032 commit 794ed1c

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/integrations/SparxstarGluonRules.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,19 @@ public function gluonGetUserConsent(): string|false {
297297
}
298298

299299
/**
300-
* Filter callback to set the consent type for this plugin.
300+
* Filter callback to provide a default consent type.
301301
*
302-
* Sets the consent mechanism to 'optin', meaning users must actively
303-
* consent before non-essential cookies or tracking is activated.
302+
* Only sets the consent type to 'optin' when no site-wide type has been
303+
* configured yet. If another plugin or the site owner has already set a
304+
* consent type, that value is preserved unchanged — this plugin must not
305+
* override the global consent mechanism.
304306
*
305307
* @since 1.0.0
306-
* @param string $type The current consent type.
307-
* @return string The consent type: 'optin'.
308+
* @param string $type The current consent type set by the site or another plugin.
309+
* @return string The existing consent type, or 'optin' when none is set.
308310
*/
309311
public function gluonSetConsentType( string $type ): string {
310-
return 'optin';
312+
return $type ?: 'optin';
311313
}
312314

313315
/**

0 commit comments

Comments
 (0)