Title: Block activation unless cookie is set?
Last modified: March 14, 2024

---

# Block activation unless cookie is set?

 *  Resolved [hmijail](https://wordpress.org/support/users/hmijail/)
 * (@hmijail)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/block-click/)
 * I use CookieYes (free level) for my cookie banner / blocker. I wanted to block
   my blog’s readers from clicking through WP Youtube Lyte’s cached placeholders
   unless they accepted cookies (in case Youtube pushes some), and I managed to 
   configure CookieYes so that it blocks the loading of the wp-youtube-lyte/lyte/
   lyte-min script. It works!
 * But now it actually it’s a bit too far: instead of the videos’ placeholders now
   I have grey blocks (with the video’s titles, I guess courtesy of the plugin and
   YT API). Which is a pity, because as we know one of the advantages of genius 
   WP Youtube Lyte is that it caches the YT façades, so we could display them without
   ever contacting YT.
 * So my question is, is it possible to display everything but just block the activation
   of the videos unless a cookie has been set? Am I missing something, is this a
   feature request…?
    -  This topic was modified 2 years, 1 month ago by [hmijail](https://wordpress.org/support/users/hmijail/).
      Reason: Completed the title
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fblock-click%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/block-click/#post-17501466)
 * afraid that currently indeed is not possible hmijail; lyte.min.js is responsible
   for both the loading of the thumbnail and the activation of the video.
 * hope this clarifies,
    frank
 *  Thread Starter [hmijail](https://wordpress.org/support/users/hmijail/)
 * (@hmijail)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/block-click/#post-17502089)
 * Aha, thank you for confirming.
 * OK, so in case you feel like implementing a new feature ;), it’d be great to 
   ignore clicks if a cookie isn’t present with a configurable name and contents.(
   e.g., CookieYes sets a cookie with the permissions granted by the user; so Lyte
   could check that the cookie exists and contains a substring).
 * Even better if, while the cookie is missing, a configurable text was overlayed;
   the text could change on an event triggered by the cookie banner acceptance.
 * Or maybe if the cookie is missing the click could just open the youtube video
   in either the current tab or a new one…
 * In any case, thank you for your work! Mozilla donor here 😉
 *  Thread Starter [hmijail](https://wordpress.org/support/users/hmijail/)
 * (@hmijail)
 * [2 years ago](https://wordpress.org/support/topic/block-click/#post-17506182)
 * Just thought of another alternative that probably would be simpler to implement
   and still would allow to build fixes on top: would it be possible to have an 
   option (e.g. a shortcode attribute or editor checkbox) so that Lyte renders the
   façade just like it does now, but doesn’t react to clicks?
   If I developed that,
   would you accept a Pull Request? I’m not a JS dev, but sounds simple enough that
   I could try.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Block activation unless cookie is set?’ is closed to new replies.

 * ![](https://ps.w.org/wp-youtube-lyte/assets/icon-128x128.png?rev=1836005)
 * [WP YouTube Lyte](https://wordpress.org/plugins/wp-youtube-lyte/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-youtube-lyte/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-youtube-lyte/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-youtube-lyte/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-youtube-lyte/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-youtube-lyte/reviews/)

## Tags

 * [cookies](https://wordpress.org/support/topic-tag/cookies/)

 * 3 replies
 * 2 participants
 * Last reply from: [hmijail](https://wordpress.org/support/users/hmijail/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/block-click/#post-17506182)
 * Status: resolved