What happened

Shares of Shake Shack (SHAK -0.56%) sank on Thursday after the restaurant chain issued a tepid growth forecast. As of 3:30 p.m. ET, its stock price was down more than 6%.

So what

Shake Shack's revenue rose 23.1% year over year to $230.8 million in the second quarter. That was below Wall Street's expectations. Analysts had projected revenue of $238.4 million.

Shake Shack's growth was fueled by new restaurant openings. It opened five company-operated stores and eight licensed locations during the quarter, bringing its total store count to roughly 395 locations.

"Despite macro challenges, we opened 13 new company-operated and licensed Shacks this quarter, including two drivethrus, a key component of our ongoing development strategy," CEO Randy Garutti said in a letter to shareholders. "Our early read on our new drive-thru format is positive and we are building our pipeline."

A 10.1% increase in "Same-Shack" sales also contributed to the gains. The company's same-store sales at its urban locations improved by 19.4%, as more people returned to traditional offices. Meanwhile, same-store sales at its suburban locations increased by 2.6%.

However, higher food and packaging costs weighed on Shake Shack's profitability. Its Shack-level operating margin, though up 3.6 percentage points sequentially, was down 0.4 percentage points year over year.

All told, Shake Shack posted a net loss of $1.2 million, or $0.03 per share, compared to net income of $1.9 million, or $0.05 per share, in the prior-year period.

Now what

Shake Shack plans to raise prices to offset its rising costs, even as inflation is already forcing many consumers to cut back on dining out. The company also warned that the trend of people returning to traditional work locations appeared to be slowing in some of its urban markets. 

Management now expects Shake Shack to generate revenue of $221 million to $226.5 million in the third quarter. That was significantly below analysts' estimates, which had forecast sales of $245.5 million.