PressTigers

using-uninstall-hook-to-delete-plugin

  • April 6, 2016

using-uninstall-hook-to-delete-plugin

Instead of writing a code in deactivation hook, uninstall.php file containing the hook should be used. This hook checks the WP_UNINSTALL_PLUGIN constant before proceeding the plugin deletion. The WP_UNINSTALL_PLUGIN constant is defined by WordPress only if an uninstall.php file is present in the plugin folder.

Get in Touch