Hadith Q11

وَالدَّلِيلُ عَلَى أَنَّ النَّبِيَّ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ إِنَّمَا نَفَى قَبُولَ الصَّلَاةِ لِغَيْرِ الْمُتَوَضِّئِ الْمُحْدِثِ الَّذِي قَدْ أحَدَثَ حَدَثًا يُوجِبُ الْوُضُوءَ، لَا كُلِّ قَائِمٍ إِلَى الصَّلَاةِ، وَإِنْ كَانَ غَيْرَ مُحْدِثٍ حَدَثًا يُوجِبُ الْوُضُوءَ
And the explanation of the evidence that the Prophet Muhammad (peace be upon him) negated the acceptance of the prayer of the person who, after committing an act that nullifies ablution (such as urination or defecation, etc.), prays without ablution—not the negation of the acceptance of the prayer of every person who stands for prayer without having committed any act that necessitates ablution.
Hadith Reference صحيح ابن خزيمه / كتاب: الوضوء / Q11