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 ‘alayhi wa sallam, is His Slave and Messenger.
Ibn Al-Qayyim cited in his book Ar-Rooh a statement related to what the questioner referred to; he wrote,
“Several of those who were not inclined to the opinions of Shaykh Al-Islam Ibn Taymiyyah informed me that they saw him (in their dreams) after his death and asked him about difficult questions on issues related to Islamic inheritance laws and other matters and he replied to their questions and guided them to the relevant correct views.” [Ar-Rooh]
What a deceased person says in a dream is to be judged in the same ways as what a living person says: whatever is in agreement with the Islamic Sharee‘ah is accepted and whatever contradicts it is to be rejected. Allaah The Exalted says (what means): {And in anything over which you disagree – its ruling is [to be referred] to Allaah. [Say], "That is Allaah, my Lord; upon Him I have relied, and to Him I turn back."} [Quran 42:10]
Allaah Knows best.