Skip to content

Add backwards-compatible allowedCategory() shim for third-party integrations #200

@over-engineer

Description

@over-engineer

Is your feature request related to a problem? Please describe.

Some integrations, such as WP Consent API, expect the allowedCategory(category: string): bool method to exist on the global pressidiumCookieConsent object.

After the migration to v3 (ref: #50), that method has been replaced by:

CookieConsent.acceptedCategory(category)

Describe the solution you'd like

We need to add a backwards-compatible shim for window.pressidiumCookieConsent.allowedCategory() to improve compatibility with third-party integrations.

window.pressidiumCookieConsent.allowedCategory = (category) => (
  CookieConsent.acceptedCategory(category)
);

Describe alternatives you've considered

N/A

Checklist

  • I have searched the GitHub issues to ensure this is not a duplicate
  • I have confirmed that this feature is not already available in the latest version of the plugin

Additional context

N/A

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestv3Related to orestbida/cookieconsent v3
No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions