| @@ -11,10 +11,10 @@ | ||
| 11 | 11 | * Should we load the integration logic. |
| 12 | 12 | * |
| 13 | 13 | * @return bool Should we load. |
| 14 | 14 | */ |
| 15 | - function should_load() { | |
| 16 | - include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
| 15 | + public function should_load() { | |
| 16 | + include_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
| 17 | 17 | |
| 18 | 18 | return is_plugin_active( 'revslider/revslider.php' ); |
| 19 | 19 | } |
| 20 | 20 | |
| @@ -22,11 +22,11 @@ | ||
| 22 | 22 | * Register integration details. |
| 23 | 23 | */ |
| 24 | 24 | public function register() { |
| 25 | 25 | |
| 26 | - add_filter( 'optml_possible_lazyload_flags', [ $this, 'add_lazyflag' ], 10, 2 ); | |
| 27 | - add_filter( 'optml_ignore_data_opt_flag', [$this, 'add_data_ignore'], 10, 3 ); | |
| 28 | - add_filter( 'optml_lazyload_bg_classes', [$this, 'add_bg_class'], 10, 1 ); | |
| 26 | + add_filter( 'optml_possible_lazyload_flags', [ $this, 'add_lazyflag' ], 10 ); | |
| 27 | + add_filter( 'optml_ignore_data_opt_flag', [ $this, 'add_data_ignore' ], 10 ); | |
| 28 | + add_filter( 'optml_lazyload_bg_classes', [ $this, 'add_bg_class' ], 10 ); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Add Slider Revolution lazyload flag. |
| @@ -34,11 +34,12 @@ | ||
| 34 | 34 | * @param array $strings Old strings. |
| 35 | 35 | * |
| 36 | 36 | * @return array New flags. |
| 37 | 37 | */ |
| 38 | - function add_lazyflag( $strings = array() ) { | |
| 38 | + public function add_lazyflag( $strings = [] ) { | |
| 39 | 39 | |
| 40 | 40 | $strings[] = 'rev-slidebg'; |
| 41 | + $strings[] = 'rs-lazyload'; | |
| 41 | 42 | |
| 42 | 43 | return $strings; |
| 43 | 44 | } |
| 44 | 45 | |
| @@ -44,13 +45,13 @@ | ||
| 44 | 45 | |
| 45 | 46 | /** |
| 46 | 47 | * Add classes for lazyload on background. |
| 47 | 48 | * |
| 48 | - * @param string $classes Old classes. | |
| 49 | + * @param array $classes Old classes. | |
| 49 | 50 | * |
| 50 | 51 | * @return array New classes. |
| 51 | 52 | */ |
| 52 | - public function add_bg_class( $classes = array() ) { | |
| 53 | + public function add_bg_class( $classes = [] ) { | |
| 53 | 54 | $classes[] = 'tp-bgimg'; |
| 54 | 55 | |
| 55 | 56 | return $classes; |
| 56 | 57 | } |
| @@ -57,15 +58,14 @@ | ||
| 57 | 58 | |
| 58 | 59 | /** |
| 59 | 60 | * Adds flag that should ignore applying the data-opt-src |
| 60 | 61 | * |
| 61 | - * @param string $flags Flag that should ignore. | |
| 62 | + * @param array $flags Flag that should ignore. | |
| 62 | 63 | * |
| 63 | 64 | * @return array New flags. |
| 64 | 65 | */ |
| 65 | - public function add_data_ignore( $flags = array() ) { | |
| 66 | + public function add_data_ignore( $flags = [] ) { | |
| 66 | 67 | $flags[] = 'rev-slidebg'; |
| 67 | - | |
| 68 | + $flags[] = 'rs-lazyload'; | |
| 68 | 69 | return $flags; |
| 69 | 70 | } |
| 70 | - | |
| 71 | 71 | } |