Thank you, I did exactly this way and it worked.
explaining better, I do not want to use the php: pass thru mode to open the image: wp-content / webpc-passthru.php? src = I want to change it so that instead the webp image
str_replace (‘uploads’, ‘uploads-webpc / uploads’, $ img). ‘. webp’;