Replace image if device is mobile

I did look up that wp_is_mobile() function that you mentioned, and yes that is php doing d=some form of “device sniffing”. But such sniffing is not so reliable.
Given the reason for this requirement, assuming this is to do with your other topic, linked for context. The issues are due to double density mobile displays specifically, wp_is_mobile() won’t condition for that, but media queries and srcset can.

<ot> I have not really closely studied the inner workings of WP. But when I saw the code for that function, it looks like WP php code is every bit as verbose as its html and css. :grimacing: </ot>