Skip to content

feat: PLG-130 - add WP Consent API categories integration#41

Merged
pleberre merged 3 commits intorelease/2.6.2from
feat/78365_evol_consent_api
Feb 24, 2026
Merged

feat: PLG-130 - add WP Consent API categories integration#41
pleberre merged 3 commits intorelease/2.6.2from
feat/78365_evol_consent_api

Conversation

@Loubal70
Copy link
Collaborator

@Loubal70 Loubal70 commented Dec 18, 2025

  • Fix initialization bug (axeptioSettings → axeptioWpConsentCategories)
  • Add 5 WP Consent API categories as virtual vendors
  • Update consent directly without Google Consent Mode dependency
  • Refactor categories data to single source of truth
  • Add WordPress favicon for consent categories

Summary by cubic

Adds native WP Consent API category integration to the Axeptio widget and syncs consent directly via wp_set_consent, independent of Google Consent Mode. Defaults all categories to deny on init and loads the WP Consent API when the plugin is active. Addresses PLG-130.

  • New Features

    • Add the five WP Consent API categories as virtual vendors with localized titles/descriptions and a WordPress favicon.
    • Update consent via wp_set_consent based on vendor choices (no Google Consent Mode required).
    • Enqueue wp-consent-api and pass the category list to the frontend when the plugin is active.
  • Bug Fixes

    • Fix initialization variable (axeptioSettings → axeptioWpConsentCategories).

Written for commit f6ab6a4. Summary will update on new commits.

- Fix initialization bug (axeptioSettings → axeptioWpConsentCategories)
- Add 5 WP Consent API categories as virtual vendors
- Update consent directly without Google Consent Mode dependency
- Refactor categories data to single source of truth
- Add WordPress favicon for consent categories
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 12 files

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="assets/js/frontend/axeptio.js">

<violation number="1" location="assets/js/frontend/axeptio.js:12">
P2: The `wp_consent_change` CustomEvent is no longer dispatched after consent is updated. This event is part of the WP Consent API specification and other consent-aware WordPress plugins may depend on it to react to consent changes. Consider dispatching the event after setting consents.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@pleberre pleberre changed the title feat: add WP Consent API categories integration feat: PLG-130 - add WP Consent API categories integration Jan 26, 2026
@linear
Copy link

linear bot commented Jan 26, 2026

@Loubal70
Copy link
Collaborator Author

The official WP Consent API event is wp_listen_for_consent_change. It is automatically dispatched by the wp_set_consent() function from the WP Consent API plugin on each call. Our code does call wp_set_consent() for every category on cookies:complete, so spec-compliant plugins still receive consent change notifications.

@claracarvalho4axeptio
Copy link

Hi @pleberre , this PR was supposed to be merged before PR#42 #42 to avoid conflicts on the trsnalations, and yet it is still open. Are we waiting on anything or can I merge this PR? We need to be careful because both PRs modify some translation files.

@pleberre pleberre merged commit 03bc938 into release/2.6.2 Feb 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants