Hydrocodone and breastfeeding

I went to the ER a few months ago and I was prescribed hydrocodone because I have severe gallbladder attacks, I was told not to feed my baby for 6 hours after taking it. Thankfully I didn’t need it until TODAY! I’m having an attack and it’s somewhat tolerable but it’s only a matter of time until I’m gonna be in sooo much pain.

Anyone else deal with this? If I MUST take the pain pill do I have to pump and dump ? Idk how it works, I exclusively breastfeed. He is 5 months old TIA