Support Forum › Support Forum › GDPR Cookie Compliance › Elementor integration
- AuthorPosts
- PremiumJuly 14, 2023 @ 4:30 pm
I enabled the setting to block iFrame’s until the user has proper accepted it’s usage. All of our videos are embedded via an Elementor video.
What I understand:
+ If we are using the privacy mode then they aren’t blocked – that’s fine
+ Lazy load – Does this work?
I read in another thread that this should work, but when I tested it unfortunately it doesn’t. Then I setup the following code:
/**
* Filters heading widgets and change their content.
*
* @since 1.0.0
* @param string $widget_content The widget HTML output.
* @param \Elementor\Widget_Base $widget The widget instance.
* @return string The changed widget content.
*
* [SB] Render Content / Elementor Hook – Add GDPR Processing
*/
function gdpr_iframe_block($content, $widget) {
if (‘video’ == $widget->get_name()) {
error_log(‘Widget video: ‘.$widget->get_name().’ ‘.var_export($content,true));
$content = apply_filters( ‘gdpr_iframe_blocker_filter’, $content );
}
return $content;
}
add_filter( ‘elementor/widget/render_content’, ‘gdpr_iframe_block’, 10, 2 );The widget being output doesn’t have any iFrame in it at this hook so clearly not working, BUT the hook provided also throws an error indicating that it doesn’t exist which is odd (in the logs).
Next I tried:
add_filter( ‘the_content’, array( ‘Moove_GDPR_Addon_Actions’, ‘gdpr_block_content_iframes’ ), 100, 1 );
This also doesn’t seem to change anything. I purposely change the settings on the link provided just to use it as a use case for testing – no privacy and no lazy loading.
Thanks for your help!
Shane
Moove Agency
July 27, 2023 @ 4:23 pmHello,
Thanks for using our plugins.
We checked the elementor plugin, and we can’t make the video section compatible with our GDPR plugin.
So instead of the Video section, you can use Shortcode section (available in elementor base plugin too) and use the following shortcode (they have to replace the video URL:
[gdpr_iframe_blocker] <iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> [/gdpr_iframe_blocker]
Hope this helps.
- AuthorPosts
The topic ‘Elementor integration’ is closed to new replies.