Hi there,
That’s a good question. Swapping out HTML output needs to be done client side as far as I can tell. But you’ve triggered my interest. I don’t see this happening any time soon, but if it looks like a good option, there’s every possibility I will work with it in the future.
What made you think of this may I ask?
Thread Starter
eic25
(@eic25)
What made you think of this may I ask?
In my point of view it is more robust to do this server side than client side (no different browsers or devices, Javascript disabled, ….).
The basics are the same. Find the corresponding image tags, load the svg file content and replace the image tag.
A place to start would be the the_content filter.
But this is not a all detail deliberate solution. I am just interested in why this are done like they are done at the moment.
Well thank you for letting me know.
I will actually look into this to see if it is possible and maybe write a version that does use PHP (if it will work) then compare performance.
I just wrote it this way because it was a solution that worked when I initially wrote the plugin and my approach was that I needed to modify the markup so went with JS.
Very interesting thoughts, thanks for your suggestion.