Bethenny Frankel and estranged husband Jason Hoppy were at the Manhattan courthouse Thursday, Oct. 2, as part of their divorce proceedings, when a judge told the 43-year-old reality TV personality - though not directly - to never wear her little daughter's sleepwear again.

"No more pajamas!" Manhattan Supreme Court Justice Ellen Gesmer told Frankel's lawyer Allan Mayefsky in divorce court Thursday, New York Daily News reported.

Gesmer was referring to the infamous photo of the "Real Housewives of New York City" alum that she posted on Instagram in July. In the controversial photo, Frankel is seen wearing her 4-year-old daughter's Hello Kitty sleepwear.

"This is my daughter's nightgown and PJ shorts. Think we're ready to start sharing clothes yet?" Frankel wrote in the post.

Apparently, not all Instagram users were pleased by the post, with many raising eyebrows over her parenting style, and some even claiming that she was "body-shaming" her daughter.

Mayefsky did not disagree with the judge's directive, but he claimed, "It was done as a joke."

"It's not a joke. Her child is not a joke," Gesmer replied, explaining that she was worried that the photo would be on the Internet for a long time until Frankel's daughter, Bryn, can read the post herself.

Neither Frankel nor Hoppy were in the courtroom when the brief discussion between Gesmer and Mayefsky took place.

The issue of Bryn's custody is already settled. The estranged couple will share responsibility for their daughter.

Meanwhile, Frankel denied rumors that she is coming back to "The Real Housewives of New York City" despite an Oct. 1 report by Us Weekly claiming that she will appear in the show's upcoming seventh season to help boost ratings.

During a SiriusXM Radio interview with Jenny Hutt, Frankel said that she thinks the speculation began because she's going in and out of Bravo, according to E! News.

"I'm talking to Andy [Cohen] about two different projects, because he's got a production company now," she explained. "I haven't signed or decided to do anything. But it's not what everyone thinks it is."

She continued: "He's doing a lot of different shows, so we're talking about a couple of different things and deciding together what we're going to do.  So that could be why everyone's writing about this."