You said that you daughter was adopting this child. Does she know anything about his background? Going to the bathroom is one of the few things that children have control of in their lives. Most children, even the ones who are in a stable environment, will regress in some manor when a change is made in the family. For example children who have been potty trained for a year or two will regress back to wetting themselves (either at night, or day, or sometimes both) when a new sibling arrives, parents fight, they move, ect. When a childs world seems to be spinning out of control this is one thing that they can control.
Now, this little man might be testing his new parents with the wetting. He might want to see how they are going to react, how they will discipline him. Or maybe it is something that he really isn't aware of. But what your daughter really needs to do, is when he comes home wet, not yell at him or even really discipline him regarding this, instead talk to him, try hard to get him to open up about what used to happen when he wet his pants, reassure him that no matter what he does he is in a safe, loving home where he will be taken care of. Now she should tell him that it is not acceptable behaivor to wet himself doing the day but that they (herself and husband) understand that this is all new to him and that he might be a little afraid. I personally would have the husband in the room on occassion as well, and let him take charge. I think the most important thing you can do is let him know that he is loved and that their is nothing he can do that will make him go away. The more they talk to him and pull things out of him the more he is going to begin to feel safe and secure. Also I would tell this little boy and talk to the teacher about it, that when at school, he needs to go to the bathroom every 3 hours. He should be able to hold it for 3 hours. Just let him know that since he said sometimes he doesn't know when it is happening ask him to just try to go every 3 hours to empty his bladder. Also ask him to write down when he has an accident, because maybe something is happening at that moment to cause it. For example, maybe their is a child at school that is picking on him, or maybe the teacher had to correct him for something, maybe he got a wrong answer, so maybe this is something that triggers this behaivor.
Also with the bedwetting at night, so children aren't potty trained for years. You might actually want to go and see a doctor about that and make sure that he doesn't have a problem, because their are children who just have no control what so ever with their bladder at night.
It doesn't sound like he is doing this behaivor to be mean. My friend was a foster parent for a little boy who was 10 or 11 and he would go and pee on the walls in the room, or go into the bathroom and pee everywere except for the toilet. It was horrible and frustrating for her. But this boy came from a very broken home and had been shuffled around foster homes for years. He was scared and this was the only thing in his life he could control. He tested and tested her with this to see if she loved him enough to keep him around. It is exteremly said for these kids, and I would really think about the physicalogical aspect for the day wetting, but again would talk to a doctor about the night wetting (as well as the day).
Good luck to her and her new family. I hope that this helps.