🔌 VidYen Plugins for WordPress
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
933 B

2 years ago
  1. <?php
  2. /*
  3. * Removing Plugin data using uninstall.php
  4. * the below function clears the database table on uninstall
  5. * only loads this file when uninstalling a plugin.
  6. */
  7. //NOTE: The VidYen MMO plugin SQL table is so small its worth removing through uninstall
  8. if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  9. /*
  10. * exit uninstall if not called by WP
  11. */
  12. if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
  13. exit();
  14. }
  15. //I commented everything out, but will install a proper uninstall page in 3.0
  16. /*
  17. * Making WPDB as global
  18. * to access database information.
  19. */
  20. global $wpdb;
  21. /*
  22. * @var $table_name
  23. * name of table to be dropped
  24. * prefixed with $wpdb->prefix from the database
  25. */
  26. $table_name_mmo = $wpdb->prefix . 'vidyen_wc_mmo';
  27. // drop the table from the database. NOTE: I called each without a loop as this should be very simple and specific. -Felty
  28. $wpdb->query( "DROP TABLE IF EXISTS $table_name_mmo" );