My First WordPress Plugin! [Comment Replacement]
// September 16th, 2008 // 8 Comments » // Geek Speak
Last night someone posted a profane comment and I was forced to replace that comment with a warning that the comment has been removed for so and so reasons.
A friend (Awais Karim) then commented asking whether I modified that original comment or was it a feature of the blog? With an empty stomach and a lot of time for Iftar, an idea of automating this process with the help of a WP plugin rushed through my mind. And believe me, without knowing much of PHP, I actually DID manage to create this plugin (within fifteen minutes) which I am proud to announce
So what does the plugin do? An array of unwanted words is maintained in a list. If the comment contains any of those words, the WHOLE comment is replaced by text of the webmaster’s choice.
For example, the list contains the following words: shit, sex, bitch
Someone comments: shoaib akhtar is a son of a bitch
Comment that appears on site: Shut Up!!
It’s not very intelligent, but hey I made it myself!!! A very useful video tutorial of making your own plugins is here.
I will put it up tonight (after eating something!!) together with a guide of how to use it.
BTW, I don’t know if such plugin is already available. Also, I haven’t named it yet [abhi abhi paida hua hai] so all suggestions are welcome!



