keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

Add filter to $converted_data #57

Closed davidpom closed 4 years ago

davidpom commented 5 years ago

On file cache_enabler_disk.class.php, line 290, would be great to have a filter inside $converted_data variable, e.g.:

$converted_data = apply_filters( 'cache_enabler_disk_converted_content', preg_replace_callback($regex_rule,'self::_convert_webp',$data) )

This way anyone can filter the content to make any replacements and have them store in cache (e.g. add webp to bg images).

svenba commented 4 years ago

Pull request is welcome :)

germanoronoz commented 4 years ago

Good news!