# Wp-rocket Lazyload

### Override Lang attribute

You can modifiy your data-lazy-src and  data-lazy-srcset attribute (or another element in dom) by using our weglot\_get\_dom\_checkers filter

```php
add_filter( 'weglot_get_dom_checkers', 'weglot_dom_check_data_lazy_src' );
function weglot_dom_check_data_lazy_src( $dom_checkers ) { //$dom_checkers contains the list of all the class we are checking by default

	class Img_Data_Lazy_Src extends Weglot\Parser\Check\Dom\AbstractDomChecker {
		const DOM       = 'img'; //Type of tag you want to detect // CSS Selector
		const PROPERTY  = 'data-lazy-src'; //Name of the attribute in that tag uou want to detect
		const WORD_TYPE = Weglot\Client\Api\Enum\WordType::IMG_SRC; //Do not change unless it's not text but a media URL like a .pdf file for example.
	}
	$dom_checkers[] = '\Img_Data_Lazy_Src'; //You add your class to the list because you want the parser to also detect it
	
	class Source_Data_Lazy_SrcSet extends Weglot\Parser\Check\Dom\AbstractDomChecker {
		const DOM       = 'source'; //Type of tag you want to detect // CSS Selector
		const PROPERTY  = 'data-lazy-srcset'; //Name of the attribute in that tag uou want to detect
		const WORD_TYPE = Weglot\Client\Api\Enum\WordType::IMG_SRC; //Do not change unless it's not text but a media URL like a .pdf file for example.
	}
	$dom_checkers[] = '\Source_Data_Lazy_SrcSet'; //You add your class to the list because you want the parser to also detect it
	
	return $dom_checkers ;
}

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.weglot.com/wordpress/use-cases/wp-rocket-lazyload.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
