• Resolved delaspuke

    (@delaspuke)


    Hello,

    Until now I have been using WP YouTube Lyte and using code snippets to automatically output a GDPR notice under each video. I used the following code for this.

    add_filter(‘lyte_match_postparse_template’,’add_gdpr_note’);
    function add_gdpr_note($lyte_template) {
    $gdpr_div = ‘<div class=”lyte_gdpr”>The video is embedded by Youtube. The privacy policy of Google applies.<hr /></div>’;
    return $lyte_template.$gdpr_div; }

    Does anyone know how I would need to adjust the code to automatically display the GDPR notice under all Lazy Load videos?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor WP Rocket

    (@wp_rocket)

    Hi @delaspuke.

    You can use the following code snippet:

    add_filter( 'rocket_lazyload_youtube_html', 'add_gdpr_note');
    
    function add_gdpr_note( $youtube_lazyload ) {
       $youtube_lazyload .= '<div class="lyte_gdpr">The video is embedded by Youtube. The privacy policy of Google applies.<hr /></div>';
    return $youtube_lazyload; 
    }

    You can change the lyte_gdpre class to one that will be used to style the GDPR note.

    Regards,

    Vasilis

    Thread Starter delaspuke

    (@delaspuke)

    Many thanks for the quick help ?? It works.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘YouTube GDPR Notice under Videos’ is closed to new replies.