From 70adce81a3885d5851b906d8bf9b46a4b97f5629 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 22 Jun 2026 08:59:07 +0200 Subject: [PATCH] Add filter to disable Elementor background images integration --- php/integrations/class-elementor.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/php/integrations/class-elementor.php b/php/integrations/class-elementor.php index 30892f055..6885dd0b6 100644 --- a/php/integrations/class-elementor.php +++ b/php/integrations/class-elementor.php @@ -67,6 +67,23 @@ public function replace_background_images_in_css( $post_css, $element ) { return; } + /** + * Filter whether Cloudinary should replace background image URLs in Elementor's generated CSS. + * + * @hook cloudinary_elementor_replace_background_images_in_css + * @since 3.3.4 + * @default {true} + * + * @param $replace {bool} Whether to replace background images. Default true. + * @param $post_css {Post} The post CSS object. + * @param $element {Element_Base} The Elementor element being processed. + * + * @return {bool} + */ + if ( ! apply_filters( 'cloudinary_elementor_replace_background_images_in_css', true, $post_css, $element ) ) { + return; + } + $settings = $element->get_settings_for_display(); $media = $this->plugin->get_component( 'media' ); $delivery = $this->plugin->get_component( 'delivery' );