Who was the disciple who struck a servant of the high priest (and cut off his ear) when Jesus was arrested? Matthew, Mark, and Luke were silent about this, while John mentioned that it was Simon Peter (John 18.10; John even mentioned the name of the servant). Why the silence, then? Well, one plausible explanation (if I remembered correctly I think I read this in Bauckham’s book, Jesus and the Eyewitnesses) is they wanted to protect Peter. The silence in the Synoptics perhaps indicated that Peter was still alive at that time and hence it is perhaps more prudent to hide his identity to avoid further repercussions. The church is ready to die for Jesus but it would be stupid and useless to provoke the Roman authorities intentionally. Suffering and persecution will come by themselves.
On the other hand, “the disciple whom Jesus loved” didn’t have any obligation to do so, since Peter was already dead by the time he wrote the Gospel of John. The contrast of Peter’s and the beloved disciple’s fate can be inferred from John 21, where post-resurrection Jesus spoke with Peter and the beloved disciple. There Peter found out what kind of death he would endure and that the beloved disciple would still be alive when Peter died. And hence the naming of Peter in the incident at the Gethsemane. However, the deliberate name silencing and identity concealing technique is in fact continued in the Gospel of John. The beloved disciple’s name is not mentioned throughout the Gospel of John.