Oh my word! I am so embarrassed. I peed my pants while teaching a class.
Yikes, that is embarrassing. How do you feel now about peeing your pants?
I'm so sorry I pissed my pants
It is understandable that teaching in a classroom can be hectic and you don't have much time to care for bodily functions throughout the day. However, it is important that you go to the bathroom when you need to so you don't have an embarrassing accident in front of your students.
Don't worry, I already put a sign up saying I have a UTI which caused the accident.
If this is an adult class I'm sure they'll understand as many of them have probably experienced something similar. Knowing about the UTI will at least stop them from gossiping about other possible causes. I'm sure this will be forgotten in no time.