@@ -31,6 +31,7 @@ class Tiny_Picture extends Tiny_WP_Base {
3131
3232
3333
34+
3435 /** @var string */
3536 private $ base_dir ;
3637
@@ -59,6 +60,10 @@ function __construct( $base_dir = ABSPATH, $domains = array() ) {
5960 return ;
6061 }
6162
63+ if ( Tiny_Helpers::is_pagebuilder_request () ) {
64+ return ;
65+ }
66+
6267 add_action ('template_redirect ' , function () {
6368 ob_start ( array ( $ this , 'replace_sources ' ), 1000 );
6469 });
@@ -189,6 +194,7 @@ private function filter_images( $content ) {
189194abstract class Tiny_Source_Base {
190195
191196
197+
192198 public $ raw_html ;
193199 protected $ base_dir ;
194200 protected $ allowed_domains ;
@@ -237,9 +243,9 @@ protected function get_element_by_tag( $html, $tagname ) {
237243 $ regex_tag = preg_quote ( $ tagname , '~ ' );
238244 if ( preg_match_all (
239245 '~< ' . $ regex_tag .
240- '\b(?:[^>" \']+|"[^"]*"| \'[^ \']* \')*>.*?</ ' .
241- $ regex_tag .
242- '>~is ' ,
246+ '\b(?:[^>" \']+|"[^"]*"| \'[^ \']* \')*>.*?</ ' .
247+ $ regex_tag .
248+ '>~is ' ,
243249 $ html ,
244250 $ matches
245251 ) ) {
@@ -379,11 +385,13 @@ protected function create_alternative_sources( $original_source_html ) {
379385 }
380386 }
381387
382- if ( $ width_descriptor &&
388+ if (
389+ $ width_descriptor &&
383390 ! self ::srcset_contains_width_descriptor (
384391 $ srcset_parts ,
385392 $ width_descriptor
386- ) ) {
393+ )
394+ ) {
387395 continue ;
388396 }
389397
@@ -412,7 +420,7 @@ protected function create_alternative_sources( $original_source_html ) {
412420 }
413421 $ source_parts [] = '/> ' ;
414422 $ sources [] = implode ( ' ' , $ source_parts );
415- }// End foreach().
423+ } // End foreach().
416424
417425 return $ sources ;
418426 }
@@ -472,6 +480,7 @@ class Tiny_Picture_Source extends Tiny_Source_Base {
472480
473481
474482
483+
475484 /**
476485 * Adds alternative format sources (e.g., image/webp, image/avif) to an existing
477486 * <picture> element based on locally available converted files.
@@ -513,6 +522,7 @@ public function augment_picture_element() {
513522
514523class Tiny_Image_Source extends Tiny_Source_Base {
515524
525+
516526 /**
517527 * Generates a formatted image source array if the corresponding local file exists.
518528 *
0 commit comments