The 32-year-old actor, who is best known for playing Will Schuester on the hit US show, will be starring in the new Lionsgate film and will play the role of Evan, who stars on a celebrity dance show with Cameron Diaz.
They then end up expecting a baby together and learn what's really important to them in life.
Other stars that recently joined the cast include: Jennifer Lopez, Chace Crawford, Rob Huebel, Elizabeth Banks, Brooklyn Decker, Anna Kendrick and Chris Rock.
Filming is set to start on the movie in the summer with a release set for May next year.