I am trying to use webp/avif compression on the page, but as the site is custom build app on roots/bedrock I had to fix several things as the option of delivering next gen image formats via picture tag using wordpres hook didn't work out of the box.
If not, maybe it's possible to add do_action hook which would enable advanded users to register it on their own?
do_action('shortpixel/init_webp_hooks', $this, $webp_option)
Shorptixel version: 5.6.2
I am trying to use webp/avif compression on the page, but as the site is custom build app on roots/bedrock I had to fix several things as the option of delivering next gen image formats via picture tag using wordpres hook didn't work out of the box.
I've notice that in the FrontController the replacement of
<img>
tag with<picture>
tag happens only forthe_content
,the_excerpt
andpost_thumbnail_html
. Is it possible that we add in here: https://github.com/short-pixel-optimizer/shortpixel-image-optimiser/blob/master/class/Controller/FrontController.php#L46 another option to runconvertImgToPictureAddWebp
?add_filter('wp_get_attachment_image', array($this, 'convertImgToPictureAddWebp'), 10, 4);
If not, maybe it's possible to add do_action hook which would enable advanded users to register it on their own?
do_action('shortpixel/init_webp_hooks', $this, $webp_option)