# optimole-wp/3.1.0/inc/compatibilities/thrive.php

Optimole – Optimize Images | Convert WebP &amp; AVIF | CDN &amp; Lazy Load | Image Optimization, version 3.1.0. 39 lines.

- Page: https://pluginprobe.com/plugins/optimole-wp/3.1.0/code/inc/compatibilities/thrive.php
- Raw: https://pluginprobe.com/plugins/optimole-wp/3.1.0/raw/inc/compatibilities/thrive.php
- Modified: 2019-11-18T11:28:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/optimole-wp/3.1.0/code/inc/compatibilities/thrive.php#L10-L20`.

```php
<?php

/**
 * Class Optml_thrive.
 *
 * @reason @reason Adding selectors for background lazyload
 */
class Optml_thrive extends Optml_compatibility {


	/**
	 * Should we load the integration logic.
	 *
	 * @return bool Should we load.
	 */
	function should_load() {
		include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

		return is_plugin_active( 'thrive-visual-editor/thrive-visual-editor.php' );
	}

	/**
	 * Register integration details.
	 */
	public function register() {
		add_filter(
			'optml_lazyload_bg_selectors',
			function ( $all_watchers ) {
				$all_watchers[] = '.tve-content-box-background';
				$all_watchers[] = '.tve-page-section-out';
				$all_watchers[] = '.thrv_text_element';

				return $all_watchers;
			}
		);
	}
}


```
