Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-smush.../core/integrat...
File: class-envira.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Integration with Envira Gallery
[2] Fix | Delete
*
[3] Fix | Delete
* @since 3.3.0
[4] Fix | Delete
* @package Smush\Core\Integrations
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
namespace Smush\Core\Integrations;
[8] Fix | Delete
[9] Fix | Delete
use Smush\Core\Controller;
[10] Fix | Delete
[11] Fix | Delete
if ( ! defined( 'WPINC' ) ) {
[12] Fix | Delete
die;
[13] Fix | Delete
}
[14] Fix | Delete
[15] Fix | Delete
/**
[16] Fix | Delete
* Class Envira
[17] Fix | Delete
*/
[18] Fix | Delete
class Envira extends Controller {
[19] Fix | Delete
/**
[20] Fix | Delete
* Envira constructor.
[21] Fix | Delete
*
[22] Fix | Delete
* @since 3.3.0
[23] Fix | Delete
*/
[24] Fix | Delete
public function __construct() {
[25] Fix | Delete
[26] Fix | Delete
$this->register_filter( 'wp_smush_get_image_attribute_names', array( $this, 'allow_envira_image_attributes_to_convert' ) );
[27] Fix | Delete
$this->register_filter( 'smush_skip_adding_srcset', array( $this, 'maybe_skip_generating_srcset' ), 10, 3 );
[28] Fix | Delete
$this->register_filter( 'wp_smush_lazyload_excluded_attributes', array( $this, 'skip_envira_image_lazyload_attribute_from_lazy_loading' ) );
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
public function should_run() {
[32] Fix | Delete
return class_exists( 'Envira_Gallery' ) || class_exists( 'Envira_Gallery_Lite' );
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
[36] Fix | Delete
public function allow_envira_image_attributes_to_convert( $attribute_names ) {
[37] Fix | Delete
$attribute_names[] = 'data-envira-src';
[38] Fix | Delete
$attribute_names[] = 'data-envira-srcset';
[39] Fix | Delete
[40] Fix | Delete
return $attribute_names;
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
public function maybe_skip_generating_srcset( $skip, $src_url, $element_markup ) {
[44] Fix | Delete
return $skip || strpos( $element_markup, 'data-envira-srcset' );
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
public function skip_envira_image_lazyload_attribute_from_lazy_loading( $attribute_names ) {
[48] Fix | Delete
$attribute_names[] = 'envira-lazy';
[49] Fix | Delete
[50] Fix | Delete
return $attribute_names;
[51] Fix | Delete
}
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function