All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu 'alyhi wa sallam, is His slave and Messenger.
Shaykh Ibn ‘Uthaymeen said: "If the fetus is not yet formed, the blood will not be considered post-partum bleeding. Consequently, she can fast and pray and her fasting is valid. However, if the fetus is formed, the blood would be considered post-partum bleeding and she should not pray or fast. The basic rule for this issue is the formation of the fetus. If it is formed, the blood would be post-partum bleeding and if it is not formed then it would not be considered as such and the rules of each case will be applicable accordingly."
Allaah Knows best.