Skip to content

Only load widget when consent has been given #20

@BramEsposito

Description

@BramEsposito

The Tawk.to Widget should not be loaded when the user has not given consent.

Most Cookie Consent banners provide a global javascript object that contains the consent and on what level consent has been given.

Multiple approaches are possible:

  • set the javascript variable in the admin UI and check for it in the widget code
  • pass the widget javascript to apply_filters so it can be wrapped in a javascript check
  • let the widget template be overruled with a customised version by using locate_template

This last one would be my preferred approach

I'll try and create a Pull request anytime soon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions