What is the maximum temperature for a photon?

Assuming that the maximum temperature for particles is $10^{32}$ kelvin (i.e., the Planck temperature) and the electroweak symmetry breaking is below $10^{15}$ kelvin, What is the maximum temperature for a photon? For example, if we could heat a photon to above $10^{15}$ kelvin, would it remain a photon or would it transform into some other type of particle such as the mathematically modelled electroweak $W_1$, $W_2$, $W_3$, or $B$ bosons?

Also, for an optional bonus point question, Would string theory or M-theory make a big difference for these calculations?

This turns out to be more complicated than you (probably) thought. The electroweak transition that produces the photon, $Z$ and $W^\pm$ is due to an interaction with the Higgs field, but it depends on the energy of the Higgs field.
So we can talk about a temperature for the Higgs field, and all the other fields it interacts with, by considering the equilibrium system in which all the quantum fields are excited and all continually exchange energy with each other. At the risk of oversimplifying yet again, the Higgs field is symmetric at high temperature and asymmetric at low temperature, and it is the transition from the high to low symmetry state that causes electroweak symmetry breaking and the conversion of the $W_1$, $W_2$, $W_3$ and $B$ bosons to the photon, $Z$ and $W^\pm$. The temperature at which this occurs is the $10^{15}$K that you refer to in your question.
The situation is very different if you consider a system of many particles, e.g. the debris from a high energer collider experiment, and consider a system in which the average photon energy is high. In this case as the energy approaches the electroweak transition energy that energy is shared with all the field including the Higgs field, and as a result the Higgs will be in its high energy symmetric state and the photons will transform back to combinations of the $W_3$ and $B$ bosons.