0

I am a newbie in WordPress... I have created my plugin... now i am creating uninstall.php file for uninstall my plugin...

this is my code of uninstall.php

if(!defined('WP_UNINSTALL_PLUGIN'))
  exit ();

 //here I am dropping my table and options...

I don't know how to call uninstall.php? from where to call? from where i can uninstall my plugin...

I know register_uninstall_hook() but when it get triggered?

Thanks in advance

0

Uninstall hook and uninstall.php file are two alternate ways to implement uninstall functionality, they are independent of each other.

When uninstall_plugin() is called it checks for uninstall.php or hook (in this order).

So if you are using file approach there is nothing special you need to do to call it. WordPress looks it's up by name and runs on uninstall natively.

  • Thanks... one more question from where i can uninstall my plugin? – user41362 Nov 11 '13 at 8:35
  • does delete and uninstall both are same? – user41362 Nov 11 '13 at 8:44
  • @user41362 I don't follow what exactly you mean by "where" there. – Rarst Nov 11 '13 at 8:47
  • i don't know how to uninstall plugin? i mean from which place i can uninstall it? – user41362 Nov 11 '13 at 8:50
  • @user41362 using WordPress admin? Delet and uninstall are synonyms if you are confused about that there. Deactivate is different. – Rarst Nov 11 '13 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.