webp-express
webp-express copied to clipboard
Convert image in theme via php
Hello, there is any method to convert uploaded file via php? I want use that method in my plugin. Many thanks for great plugin :)
1+
I noticed that there is a function webPExpressAlterHtml()
, but it seems that the file this function is in is never loaded because when I tried to use it I got a fatal function does not exist error.
You could do: WebPExpress\Convert::convertFile($absolutePathToSourceFile)
.
Make sure to wrap it in a try..catch statement.
The function takes other arguments. You find the code in webp-express/lib/classes/Convert.php