A federal judge ordered the Trump administration on Friday to give legal advocates 12-hours notice of when and where immigrant families would be reunited to avoid the chaos that has hampered the process so far.

The order came during a hearing in San Diego after complaints from the American Civil Liberties Union about rapidly changing logistics, that in some cases left legal advocates and parents scrambling to figure our where they were supposed to be going or when the children would arrive.

Judge...