• Resolved mathebotond

    (@mathebotond)


    How can I run a code snippet in case the user rejects a specific type of cookie? For example to refresh the page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mathebotond

    (@mathebotond)

    Never mind, I see that it always refreshes, so I can put logic to page load.

    Plugin Author Moove Agency

    (@mooveagency)

    Hi @mathebotond,

    Thanks for using our plugins.

    The refresh is disabled by default, if the plugin refresh the page when you save the settings, it means you’re using the following hook to force the page reload:
    add_action( 'gdpr_force_reload', '__return_true' );

    We have implemented several hooks & functions to determine which cookies are used, so you can find these in the Admin -> GDPR Cookie Compliance -> Help, Hooks, Filters & Shortcodes section.
    This is a simple example:

    if ( function_exists( 'gdpr_cookie_is_accepted' ) ) {
      /* supported types: 'strict', 'thirdparty', 'advanced' */
      if ( gdpr_cookie_is_accepted( 'thirdparty' ) ) {
        echo "GDPR third party ENABLED content";
      } else {
        echo "GDPR third party RESTRICTED content";
      }
    }

    Hope this helps.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Event on reject’ is closed to new replies.