Abu Zubair narrated that Abdur Rahman bin Aiman, the freed slave of Azza, was asking Abdullah bin Umar (may Allah be pleased with them both), and Abu Zubair was listening. He asked: "What is your opinion about a man who divorces his wife while she is menstruating?" Ibn Umar (may Allah be pleased with them both) replied that Abdullah bin Umar (i.e., he himself) had divorced his wife during her menstruation, so the Prophet (ﷺ) said: "Tell him (Ibn Umar) to take his wife back, and when she becomes pure from her menstruation, then if he wishes, he may divorce her or keep her in marriage." Ibn Umar (may Allah be pleased with them both) said, Allah the Exalted has said: "O Prophet! When you divorce women, divorce them at the commencement of their waiting period." Imam Shafi'i (may Allah have mercy on him) was uncertain in «في قُبل عدتهن» and «لقبل عدتهن».
Hadith Referenceمسند الإمام الشافعي / كتاب الطلاق / 1239
Hadith Takhrijاخرجه مسلم ،الطلاق، باب تحريم طلاق الحائض بغير رضاها ، وأنه لو خاف ...... الخ (1471)۔