I have copied your filter and it does not work, the urls continue to appear the same, I have put the corresponding id, I have also cleared cache and tried in several browsers just in case. Something is wrong with the filter.
In case it has something to do with it, which I don't think, the images load in document.addEventListener("DOMContentLoaded", function(event)
Help me here, you can test the filter, I don't think it will work for you, I have also tried on normally loaded images and I have also tried with disabled plugins just in case it was some incompatibility. The filter does not work.
The pency lazy script is warping my images in the custom script I use to display images.
The original urls I use are like this:
and transform them into this:
consequently I get the error: Uncaught SyntaxError: missing ] after element list
and the problem I imagine comes from the svg url and its quotes:
Solution? Some fix? Can you send me the previous version the shortcodes and performance until it is solved?
Hi,
Please install the Code Snippet plugin, then create a new snippet with the following content:
add_filter( 'hpp_disallow_lazyload_attr', function ( $ok, $tag ) { $exclude_lazy_array = array( 'idI1', 'idI2', 'idI3' ); foreach ( $exclude_lazy_array as $val2 ) { if ( strpos( $tag['id'], $val2 ) !== false ) { return 1; } } return $ok; }, 10, 2 );The script above will exclude all the image that has ID in "$exclude_lazy_array".
Regards,
PenciDesign.
I have copied your filter and it does not work, the urls continue to appear the same, I have put the corresponding id, I have also cleared cache and tried in several browsers just in case. Something is wrong with the filter.
In case it has something to do with it, which I don't think, the images load in document.addEventListener("DOMContentLoaded", function(event)
Help me here, you can test the filter, I don't think it will work for you, I have also tried on normally loaded images and I have also tried with disabled plugins just in case it was some incompatibility. The filter does not work.
Hi,
Please add more this code to the snippet:
add_filter( 'hpp_disallow_lazyload', function ( $ok, $tag ) {$exclude_lazy_array = array( 'idI1', 'idI2', 'idI3' );
foreach ( $exclude_lazy_array as $val1 ) {
if ( strpos( $tag, $val1 ) !== false ) {
return 1;
}
} return $ok;
}, 10, 2 );
Regards,
PenciDesign.
Now yes, it already worked. Thanks a lot.