Israel has ordered its army to prepare for a full closure of the West Bank following an attack.