bcn_uninstaller

Breadcrumb NavXT uninstaller class.

Defined (1)

The class is defined in the following location(s).

/uninstall.php  
  1. class bcn_uninstaller extends mtekk_adminKit_uninstaller 
  2. protected $unique_prefix = 'bcn'; 
  3. protected $plugin_basename = null; 
  4.  
  5. public function __construct() 
  6. $this->plugin_basename = plugin_basename('/breadcrumb-navxt.php'); 
  7. parent::__construct(); 
  8. /** 
  9. * Options uninstallation function for legacy 
  10. */ 
  11. private function uninstall_legacy() 
  12. delete_option($this->unique_prefix . '_options'); 
  13. delete_option($this->unique_prefix . '_options_bk'); 
  14. delete_option($this->unique_prefix . '_version'); 
  15. delete_site_option($this->unique_prefix . '_options'); 
  16. delete_site_option($this->unique_prefix . '_options_bk'); 
  17. delete_site_option($this->unique_prefix . '_version'); 
  18. /** 
  19. * uninstall breadcrumb navxt admin plugin 
  20. *  
  21. * @return bool 
  22. */ 
  23. private function uninstall_options() 
  24. if(version_compare(phpversion(), '5.3.0', '<')) 
  25. return $this->uninstall_legacy(); 
  26. //Grab our global breadcrumb_navxt object 
  27. global $breadcrumb_navxt; 
  28. //Load dependencies if applicable 
  29. if(!class_exists('breadcrumb_navxt')) 
  30. require_once($this->_get_plugin_path()); 
  31. //Initalize $breadcrumb_navxt so we can use it 
  32. $bcn_breadcrumb_trail = new bcn_breadcrumb_trail(); 
  33. //Let's make an instance of our object takes care of everything 
  34. $breadcrumb_navxt = new breadcrumb_navxt($bcn_breadcrumb_trail); 
  35. //Uninstall 
  36. return $breadcrumb_navxt->uninstall(); 
  37. }  
  38.  
  39. /** 
  40. * uninstall method 
  41. *  
  42. * @return bool wether or not uninstall did run successfull. 
  43. */ 
  44. public function uninstall() 
  45. //Only bother to do things  
  46. if($this->is_installed()) 
  47. return $this->uninstall_options(); 
  48. }  
  49.  
  50. } /// class bcn_uninstaller