MyBB Community Forums
Deactivating the plugin - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Development (https://community.mybb.com/forum-68.html)
+---- Thread: Deactivating the plugin (/thread-55902.html)



Deactivating the plugin - shaks786 - 2009-09-02

hi,
i am creating a plugin, which when its activated, it adds a global template.
how do i get mybb to delete this template once the plugin is deactivated?


RE: Deactivating the plugin - exdiogene - 2009-09-02

You put the code you need in your plugin function YourPluginName_deactivate()


RE: Deactivating the plugin - AndrewPH - 2009-09-02


function PLUGIN NAME_deactivate() {

	global $db;

	// Remove the custom template
	$db->delete_query("templates", "title = 'TEMPLATE NAME'");

}


Try this Smile


RE: Deactivating the plugin - shaks786 - 2009-09-02

thanks Andrew!
that worked!