In short...
In short, these kinds of nadhr are one type of charity given on behalf of the Prophets and virtuous people the reward of which goes to them and none of the Islamic scholars have objected to such a charity given on behalf of the dead. For acquainting the respected readers with the fallacious thinking of the Wahhabis, we shall discuss this matter in greater length.
In Arabic language, the matter of charity is presented with لام but sometimes, this letter is taken in the sense of aim, goal and motive, like; لله عليَّ and sometimes it is meant to describe its usage like إنما الصدقات للفقراء and while carrying out the paradigm of nadhr (vow) they use both kinds of لام and say: نذرت لله إن قُضيت حاجتي أن أذبح للنبيَّ The first لام is the same لام of goal and motive and it implies that the aim of this nadhr is seeking the satisfaction of Allah and gaining His proximity whereas the second لام indicates the very object which derives benefit from this nadhr and the reward is presented to him.
لام in صليت لله and or نذرت لله is for expressing goal and motive i.e. I recited salat and I did nadhr because of obeying the commands of Allah and seeking His satisfaction and proximity. On the other hand لام in اذبح للنبيّ اولوالدىّ او لوالدتيis for clarifying the beneficiary and showing that this action takes place on his behalf and it is he who reaps the benefits of its reward.
Such nadhr not only is not an 'ibada (worship) of that person but rather, it is 'ibada of Allah for the sake of benefit of the creatures of Allah. In Islamic traditions, there are many instances regarding this matter where we shall hereunder mention a few of them. (1) One of the companions of the Holy Prophet (s) by the name of Sa’d told the Prophet: “My mother has died and if she was alive today, she would be giving charity.
Supposing that I give charity on her behalf, will she derive any benefit from it?” The Holy Prophet (s) replied: “Yes”. Thereafter, he asked the Prophet (s) that amongst all the charities which charity was the most useful and the Prophet (s) replied: “Water”.
Sa’d dug a well and said: هذه لإم سعد As you must have noticed, the لام of this sentence is different from the لام that is present in the sentence نذرت لله the first لام is for expression of motive and the second لام shows the object deriving the gain. [^5] (2) During the time of the Holy Prophet (s), a person made a nadhr to sacrifice a camel at Bavana.