Skip to content

Commit

Permalink
feat: improve compatibility with various page builders: Divi, Thrive,…
Browse files Browse the repository at this point in the history
… Elementor, Beaver
  • Loading branch information
selul committed Nov 18, 2019
1 parent b749c7e commit a4391b4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion inc/compatibilities/beaver_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public function register() {
add_filter(
'optml_lazyload_bg_selectors',
function ( $all_watchers ) {
$all_watchers = array_merge( $all_watchers, ['.fl-col-content', '.fl-row-bg-photo > .fl-row-content-wrap'] );
$all_watchers[] = '.fl-col-content';
$all_watchers[] = '.fl-row-bg-photo > .fl-row-content-wrap';

return $all_watchers;
}
);
Expand Down
8 changes: 7 additions & 1 deletion inc/compatibilities/divi_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ class Optml_divi_builder extends Optml_compatibility {
function should_load() {
return strcmp( wp_get_theme(), 'Divi' ) === 0;
}

/**
* Register integration details.
*/
public function register() {
add_filter(
'optml_lazyload_bg_selectors',
function ( $all_watchers ) {
$all_watchers = array_merge( $all_watchers, ['.et_pb_slides > .et_pb_slide', '.et_parallax_bg', '.et_pb_video_overlay', '.et_pb_module', '.et_pb_row', '.et_pb_with_background'] );
$all_watchers[] = '.et_pb_slides > .et_pb_slide';
$all_watchers[] = '.et_parallax_bg';
$all_watchers[] = '.et_pb_video_overlay';
$all_watchers[] = '.et_pb_module';
$all_watchers[] = '.et_pb_row';
$all_watchers[] = '.et_pb_with_background';
return $all_watchers;
}
);
Expand Down
2 changes: 1 addition & 1 deletion inc/compatibilities/elementor_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function register() {
add_filter(
'optml_lazyload_bg_selectors',
function ( $all_watchers ) {
$all_watchers = array_merge( $all_watchers, ['.elementor-widget-container'] );
$all_watchers[] = '.elementor-widget-container';
return $all_watchers;
}
);
Expand Down
5 changes: 4 additions & 1 deletion inc/compatibilities/thrive.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ public function register() {
add_filter(
'optml_lazyload_bg_selectors',
function ( $all_watchers ) {
$all_watchers = array_merge( $all_watchers, ['.tve-content-box-background', '.tve-page-section-out', '.thrv_text_element'] );
$all_watchers[] = '.tve-content-box-background';
$all_watchers[] = '.tve-page-section-out';
$all_watchers[] = '.thrv_text_element';

return $all_watchers;
}
);
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: optimole
Tags: image optimization, convert webp, responsive images, lazy load, images, optimization, performance, photos
Requires at least: 4.7
Tested up to: 5.2
Tested up to: 5.3
Requires PHP: 5.4
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
Expand Down

0 comments on commit a4391b4

Please sign in to comment.