What if no version query string was applied to the asset’s URL? Then there’s no reason for us to run the conversion code. Right? That regex pattern is slow. So we don’t want to run it unless it’s needed. When does WordPress not append a version query string? Think about it. Go look up wp_enqueue_script. Look at the description for the version parameter. In this episode, we’ll explore 2 different techniques of checking if the incoming asset’s URL has the version query string.
You are here: / Regex