function fa_converse_webp($matches) { return $matches[1] . $matches['2'] . '!/ format/webp'; //Seven Bulls/ Format/webp is replaced by the following fields //? imageView2/2/format/webp } function fa_converse_webp_filter($content){ global $post; $content = preg_replace_callback("/(<img[^>]*src *= *["']?)([^"']*)/i", 'fa_converse_webp' , $content); return $content; } function fa_is_support_webp(){ return strstr($_SERVER['HTTP_ACCEPT'],'image/webp'); } if ( fa_is_support_webp() ) add_filter('the_content','fa_converse_webp_filter');
!/ format/webp
? imageView2/2/format/webp