In general, it is best to have a signed release form when publishing any photo, schoolwork, or identifying information. A search on "media consent form for schools" or similar phrase will turn up many examples.
Following are links to two federal statutes that apply to schools.
Family Educational Rights & Privacy Act (FERPA): Federal statutes applying to public release of info in general.
Children's Internet Protection Act (CIPA): Federal statutes for schools receiving E-Rate funding, applying specifically to internet content both about the student and accessible by the student.
It is advisable to consult an attorney for questions about specific situations, and to have your release form reviewed to make sure it is adequate for your intended purposes.