In July, the Washoe County School District avoided a free speech fight by backing down after an eighth-grader sued when he was told he couldn’t wear a pro-gun T-shirt to school.

And if a similar Wisconsin case is any indication, the decision saved the Washoe district from the embarrassment of losing a First Amendment legal action in court.

On Friday, U.S. District Judge Lynn Adelman issued a preliminary injunction against a Wisconsin school district forbidding it from enforcing a dress code that banned dress depicting weapons or even mentioning the word “gun.”

Such a prohibition is likely unconstitutional, the judge ruled. “Even short deprivations of First Amendment rights constitute irreparable harm,” he wrote.

Matthew Schoenecker, a sophomore at Markesan High School, wore three shirts to school that raised the ire of administrators. One depicted the word “love” with the letters formed by a handgun, grenade, knives and an assault rifle. Another T-shirt said “celebrate diversity” and featured a depiction of a dozen different types of firearms.

Mr. Schoenecker was told he had to either remove the clothing, cover it up or spend the day in an “isolated cubicle,” the Milwaukee Journal Sentinel reported.

The student sued, and last week’s ruling allows the action to move forward while preventing the district from enforcing the policy in the interim.

The facts in the Wisconsin dispute closely mirror the Washoe case, in which a middle school student was twice disciplined for wearing gun-related shirts — one that featured the logo of a local gun store and another that promoted the Firearms Policy Coalition and featured the words “Don’t Tread On Me” along with a coiled snake.

In response to the lawsuit, Washoe officials agreed to pay a portion of the student’s legal fees and to remove from the dress code a ban on clothing that “promotes weapons.”

It was a smart move. Like the Wisconsin student, the Reno middle-schooler would likely have prevailed in the justice system. In both instances, the dress codes were targeting speech based on content and viewpoint. Do you think school administrators would have taken the same hard line had a student worn a T-shirt attacking the Second Amendment?

“Washoe County School District and its staff understand the importance of individual student expression,” the district’s chief general counsel said in a news release after agreeing in July to settle with the Reno student, “and we encourage families to communicate with their school administration if they believe staff has infringed on those rights.”

Good. That’s a lesson the folks in Wisconsin should emulate lest they waste more taxpayer treasure trying to subvert the First Amendment in an effort to delegitimize the Second.