-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adds compatibility with Jetelements Slider
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/** | ||
* Class Optml_jet_elements. | ||
* | ||
* @reason Disable lazyload on jetelements slider. | ||
*/ | ||
class Optml_jet_elements 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( 'jet-elements/jet-elements.php' ); | ||
} | ||
|
||
/** | ||
* Register integration details. | ||
*/ | ||
public function register() { | ||
add_filter( 'optml_possible_lazyload_flags', [ $this, 'add_ignore_lazyload' ], PHP_INT_MAX, 1 ); | ||
} | ||
|
||
|
||
/** | ||
* Add ignore lazyload flag. | ||
* | ||
* @param array $flags Old flags. | ||
* | ||
* @return array New flags. | ||
*/ | ||
public function add_ignore_lazyload( $flags = array() ) { | ||
$flags[] = 'sp-image'; | ||
|
||
return $flags; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters