Hi @p47ri0t!
I’m afraid that this is not something that can be done for the time being.
You will need to either target a class using the following filter:
function rocket_lazyload_exclude_class( array $attributes ) {
// EDIT/REPLACE THESE EXAMPLES:
// you can add as many classes as you want, one per line.
// IMPORTANT: The string match is literal, the string assigned to $attributes must exactly match the HTML markup.
$attributes[] = 'class="divi-slider"';
//In above example, the class must be exactly class="divi-slider". If the actual class attribute is class="divi-slider something-else", the exclusion will not work.
$attributes[] = 'class="some-image-';
// In the above example, note the missing double quotes at the end. This would exclude all images with a class of some-image-123, some-image-bla-bla, some-image-whatever-else etc. from being lazy-loaded, and it will also include cases where other classes are present: class="some-image-123 other-class and-other-one".
$attributes[] = 'specific-class-name';
// You can also target one specific class name using only the name of the class. Any image using that class name will be excluded. it will cover cases like class="some-image-123 other-class specific-class-name and-other-one"
// STOP EDITING.
return $attributes;
}
add_filter( 'rocket_lazyload_excluded_attributes', 'rocket_lazyload_exclude_class' );
Or targeting a file name pattern using the following filter:
function exclude_src( array $excluded_src ) {
// EDIT/REPLACE THESE EXAMPLES:
$excluded_src[] = 'example.com'; // <img src="example.com">
$excluded_src[] = '/example-path'; // <img src="/example-path/image.jpg">
$excluded_src[] = '/example?query'; // <img src="example?query=image.jpg">
// STOP EDITING.
return $excluded_src;
}
add_filter( 'rocket_lazyload_excluded_src', 'exclude_src' );
Best regards,
Adame