J.K.
My dd did something like this around that age. She is an only child so it had nothing to do with regression after a new baby. What we finally figured out was....she flushed the potty at my mom's one day and it overflowed. It freaked her out. We got her to going on the potty again but it was 2-3 YEARS before she would flush or even be in the room/stall when you flushed the toilet. Maybe something like that happened to her?