Trump planned to declare a national emergency to obtain funding for his border wall.