The midfielder has played over 250 games for Cardiff and scored more than 60 goals. He still had two years left on his current deal but the club have moved to tie him to the Bluebirds to counter interest from teams like Fulham and WBA.
"We're absolutely delighted that Peter has committed himself to the club for the longer term following a couple of top flight clubs coming in for him," said manager Malky Mackay.
"I had a good conversation with him and he's decided to commit his future with us right here, so on behalf of my staff and the club we are happy to have backed that commitment by improving the terms of his contract.
"He's still a relative youngster who is great to work with, and I've very much enjoyed having him here as one of my players over the last year, during which time he's improved again.
"Going forward he's someone who I won't stop pushing because I see so much talent there.
"All of us here work hard with him in training every day, but he also puts a lot in himself. Underneath his calm demeanour there's a real determination to play at the top level, and we're happy that he's committed that desire to trying to achieve his goals with Cardiff City.
"We all want to push on and have every hope to do that together."