@GiantSpaceHamster but how do you enforce it where the family actively seek out the media?
In family proceedings there is the threat of and on occasion imprisonment for people that break Court Orders. They are held in contempt. Judges are willing to send people to prison for breaches of orders.
But in cases such as these, where a mother / father wishes to be with their child in the most tragic of circumstances where time is limited but is communicating with the media through either manipulation of third party groups or desperation or grief (whatever you think is behind this). No Judge would hold them in contempt and send them to prison.
So without effective enforcement, you can't make a law (I.e to keep the child's details private) because people know a Judge wouldn't be the person to send the parent to jail (and possibly the child be without their parent when they die) so the parent will always be someone that pushes its.
This is just one very small reason why these cases are horrendously difficult and tragic. There is no easy answers and one point that works in one system, won't easily work in another.