"American Idol" alum Katharine McPhee has quoted a famous line from Taylor Swift's "Shake It Off" as she defends her husband, David Foster, from critics.

The 12-time Grammy-winning composer created a buzz Tuesday for uploading a photo of his wife in a black bikini, which highlighted her toned body and flat belly. In the caption, Foster wrote, "What baby!"

While the post garnered nearly 23,000 likes and some positive comments, it also drew criticisms, with one commenter calling the caption "uncomfortable antiquated compliments." Another person called out Foster, noting, "Weird thing to post about your wife who had a public bout with bulimia. Ick."

"You'd leave her if she didn't 'bounce back' right away and we all know it. Also, this is especially gross of you because she has suffered from an eating disorder in the past," another netizen said. In response to this comment, someone brought up Foster's ex-wife, Yolanda Hadid, saying, "right? Just like he left Yolanda for being sick…"

A day after her husband's post received flak, McPhee uploaded a photo of herself in a red swimsuit and wrote, "I'm sorry but we are not sorry. And for all of you who can't deal with it maybe this helps. I've struggled with weight my whole 20s and 30. I've gone up and down 10 times over. Does that make you feel better?"

The "Scorpion" actress went on to share that she lost baby weight without dieting and say, "Diets are the worst."

"I've let me body do its thing and found a great workout. That's it. And guess what? I'll probably gain weight again at some point too. Who cares? BUT people freaking out about what my husband captioned seriously get a life... Stop being so offended by what people post who have zero impact on your life and move on," she added.

McPhee concluded her post by saying, "Maybe you should have more of an attitude of like, let's say… 'oh that's nice he thinks his wife is hot.' I cannot with this overly sensitive society right now. But as Taylor Swift said haters gonna hate _ byyeeee."

McPhee struggled with bulimia before she joined "American Idol." A treatment program and therapy helped her overcome it. However, she worried about the eating condition relapsing when she was pregnant.

"The biggest challenge for me through the pregnancy was really the body issue stuff just suddenly came up in a way that hadn't been present in a long time," she told USA Today in March, just a few days after she gave birth to her first child with Foster in February.

McPhee also said she was shocked when thoughts of disordered eating resurfaced during the first trimester of her pregnancy. She turned to therapy again, which helped her successfully manage her issues with hunger and food.

David Foster and Katharine McPhee
Pictured: David Foster and Katharine McPhee attending the “Kaleidoscope” rehearsal at Verizon Center in Washington, D.C. on Nov. 16, 2009. Paul Morigi/Getty Images