| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Class Optml_thrive. |
| 5 |
* |
| 6 |
* @reason @reason Adding selectors for background lazyload |
| 7 |
*/ |
| 8 |
class Optml_thrive extends Optml_compatibility { |
| 9 |
|
| 10 |
|
| 11 |
/** |
| 12 |
* Should we load the integration logic. |
| 13 |
* |
| 14 |
* @return bool Should we load. |
| 15 |
*/ |
| 16 |
function should_load() { |
| 17 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 18 |
|
| 19 |
return is_plugin_active( 'thrive-visual-editor/thrive-visual-editor.php' ); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Register integration details. |
| 24 |
*/ |
| 25 |
public function register() { |
| 26 |
add_filter( |
| 27 |
'optml_lazyload_bg_selectors', |
| 28 |
function ( $all_watchers ) { |
| 29 |
$all_watchers[] = '.tve-content-box-background'; |
| 30 |
$all_watchers[] = '.tve-page-section-out'; |
| 31 |
$all_watchers[] = '.thrv_text_element'; |
| 32 |
|
| 33 |
return $all_watchers; |
| 34 |
} |
| 35 |
); |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
|