I would never ask.
I “forgot” to invite one guy from work to my wedding and someone mentioned it to me after the wedding. I felt awful that he felt badly about it. Did he feel that badly? I don’t know, but other people from the group felt I purposely excluded him. I hadn’t. I was starting to become very aware of the cost of the wedding when I was making my list, and he was not someone I interacted with as much as the others who were invited. I wish now I had invited him, but there was no mal intent.
I also didn’t invite children initially, because a few people said not to, and in the end children were allowed, but I had failed to go back and make sure the children of a cousin of mine got invited. I feel horrible about it to this day. My only excuse is I was young and overwhelmed.
I never let my feelings get hurt over not being invited to a wedding. It is a stressful time and can cost a lot of money. I am always gracious and always if it ever comes up put the person’s mind at ease that I am fine that I wasn’t invited and I don’t feel slighted.
I still buy them gifts sometimes, if I feel compelled to. It depends on the situation. I won’t if it might come off as some sort of way to induce guilt, I don’t ever send a gift for that reason, I send it because I am happy for the couple. I might wait until after the wedding. As I get older this is less of a thing with peers, because often no gifts are expected, unless it is one of their children getting married.