Scholars have different opinions about this matter: the most likely one is that if the mother is still married then she is obliged to nurse her child. However, if she is divorced, then there is no obligation for her to do so, unless the child is harmed by that, then she should nurse him.(˹Divorced˺ mothers will breastfeed their offspring for two whole years, for those who wish to complete the nursing ˹of their child˺. The child’s father will provide reasonable maintenance and clothing for the mother ˹during that period˺. No one will be charged with more than they can bear. No mother or father should be made to suffer for their child. The ˹father’s˺ heirs are under the same obligation. But if both sides decide—after mutual consultation and consent—to wean a child, then there is no blame on them. If you decide to have your children nursed by a wet-nurse, it is permissible as long as you pay fairly. Be mindful of Allah, and know that Allah is All-Seeing of what you do.) Al-Baqara 2:233
في المسألة خلاف بين أهل العلم الأقرب أن يقال إن المرأة إن كانت زوجة لزمها إرضاع صغيرها و إن كانت مطلقة لم يلزمها ذلك ما لم يتضرر الطفل.(وَعَلَى الْمَوْلُودِ لَهُ رِزْقُهُنَّ وَكِسْوَتُهُنَّ بِالْمَعْرُوفِ ۚ لَا تُكَلَّفُ نَفْسٌ إِلَّا وُسْعَهَا ۚ لَا تُضَارَّ وَالِدَةٌ بِوَلَدِهَا وَلَا مَوْلُودٌ لَّهُ بِوَلَدِهِ ۚ وَعَلَى الْوَارِثِ مِثْلُ ذَٰلِكَ ۗ فَإِنْ أَرَادَا فِصَالًا عَن تَرَاضٍ مِّنْهُمَا وَتَشَاوُرٍ فَلَا جُنَاحَ عَلَيْهِمَا ۗ وَإِنْ أَرَدتُّمْ أَن تَسْتَرْضِعُوا أَوْلَادَكُمْ فَلَا جُنَاحَ عَلَيْكُمْ إِذَا سَلَّمْتُم مَّا آتَيْتُم بِالْمَعْرُوفِ ۗ وَاتَّقُوا اللَّـهَ وَاعْلَمُوا أَنَّ اللَّـهَ بِمَا تَعْمَلُونَ بَصِيرٌ ﴿٢٣٣﴾) البقرة 2: 233