Do the replace here instead. That way you only need to do it once, and you don't need the weird $wid in the widget code