-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add filter to allow customisation of Consent Mode defaults. #8383
Comments
AC ✔️ |
IB ✅ |
QA Update:
|
Hi @wpdarren, this filter is essentially independent of the WP Consent API plugin status and any existing third-party plugins. It's purely there to allow modification of the default consent parameters that Site Kit sets when the Consent Mode feature is enabled. It's conceivable that some third party plugin may decide to integrate with it in future (I don't think this is particularly likely, but it's certainly possible), but in order to do so the plugin would need to write code to explicitly make use of the filter, which has obviously just been added and is not in a SK release yet so nobody outside of our team will have actually seen and used it as of yet. |
QA Update: ✅@techanvil thank you for the clarification there. I did think that would be the case, but wanted to double check. Verified: When no filter is added
When filter is added
|
Feature Description
At present, we provide the
googlesitekit_consent_category_map
filter to allow the mapping of CMP consent categories to Consent Mode parameters.However, we don't provide a filter to allow customising the default consent values that are set. It would be useful to provide a filter so as to allow these defaults to be modified, thus allowing users complete control over the consent mode parameters.
site-kit-wp/includes/Core/Consent_Mode/Consent_Mode.php
Lines 86 to 101 in fe57e17
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
googlesitekit_consent_defaults
should be added which allows the default consent parameters to be customised.Implementation Brief
googlesitekit_consent_defaults
filter for the default settings and pass current array as default valuesite-kit-wp/includes/Core/Consent_Mode/Consent_Mode.php
Lines 86 to 93 in fe57e17
$consent_defaults = apply_filters( 'googlesitekit_consent_defaults', array(...) );
Test Coverage
QA Brief
1. When no filter is added
2. When filter is added
consent-mode-defaults-filter.php
insidewp-content/mu-plugins/
directory.ad_storage
,ad_user_data
andwait_for_update
.Changelog entry
googlesitekit_consent_defaults
filter to allow customisation of Consent Mode defaults.The text was updated successfully, but these errors were encountered: