yith_wcwl_uninstall

The YITH WooCommerce Wishlist yith wcwl uninstall function.

Description

yith_wcwl_uninstall(); 

Usage

  1. if ( !function_exists( 'yith_wcwl_uninstall' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yith-woocommerce-wishlist/uninstall.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = yith_wcwl_uninstall(); 
  7.  

Defined (1)

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

/uninstall.php  
  1. function yith_wcwl_uninstall() { 
  2. global $wpdb; 
  3.  
  4. // define local private attribute 
  5. $wpdb->yith_wcwl_items = $wpdb->prefix . yith_wcwl; 
  6. $wpdb->yith_wcwl_wishlists = $wpdb->prefix . 'yith_wcwl_lists'; 
  7.  
  8. // Delete option from options table 
  9. delete_option( 'yith_wcwl_version' ); 
  10. delete_option( 'yith_wcwl_db_version' ); 
  11. $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", 'yith_wcwl_%' ) ); 
  12.  
  13. //delete pages created for this plugin 
  14. wp_delete_post( get_option( 'yith-wcwl-pageid' ), true ); 
  15.  
  16. //remove any additional options and custom table 
  17. $sql = "DROP TABLE IF EXISTS `" . $wpdb->yith_wcwl_items . "`"; 
  18. $wpdb->query( $sql ); 
  19. $sql = "DROP TABLE IF EXISTS `" . $wpdb->yith_wcwl_wishlists . "`"; 
  20. $wpdb->query( $sql );