gads_dash_uninstall

The Google Adsense Dashboard gads dash uninstall function.

Description

gads_dash_uninstall(); 

Usage

  1. if ( !function_exists( 'gads_dash_uninstall' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-adsense-dashboard/gads_dash.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = gads_dash_uninstall(); 
  7.  

Defined (1)

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

/gads_dash.php  
  1. function gads_dash_uninstall() { 
  2. global $wpdb; 
  3. if (is_multisite ()) { // Cleanup Network install 
  4. foreach ( wp_get_sites () as $blog ) { 
  5. switch_to_blog ( $blog ['blog_id'] ); 
  6. $sqlquery = $wpdb->query ( "DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_gadsdash%%'" ); 
  7. $sqlquery = $wpdb->query ( "DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_gadsdash%%'" ); 
  8. delete_option ( 'gads_dash_ads', 0 ); 
  9. delete_option ( 'gads_dash_channels', 0 ); 
  10. delete_option ( 'gads_dash_access', 'manage_options' ); 
  11. delete_option ( 'gads_dash_style', 'green' ); 
  12. delete_option ( 'gads_dash_cachetime', 3600 ); 
  13. delete_option ( 'gads_dash_timezone', true ); 
  14. delete_option ( 'gads_dash_userapi', 1 ); 
  15. delete_option ( 'gads_dash_apikey', '' ); 
  16. delete_option ( 'gads_dash_clientid', '' ); 
  17. delete_option ( 'gads_dash_clientsecret', '' ); 
  18. restore_current_blog (); 
  19. } else { // Cleanup Single install 
  20. $sqlquery = $wpdb->query ( "DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_gadsdash%%'" ); 
  21. $sqlquery = $wpdb->query ( "DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_gadsdash%%'" ); 
  22. delete_option ( 'gads_dash_ads', 0 ); 
  23. delete_option ( 'gads_dash_channels', 0 ); 
  24. delete_option ( 'gads_dash_access', 'manage_options' ); 
  25. delete_option ( 'gads_dash_style', 'green' ); 
  26. delete_option ( 'gads_dash_cachetime', 3600 ); 
  27. delete_option ( 'gads_dash_timezone', true ); 
  28. delete_option ( 'gads_dash_userapi', 1 ); 
  29. delete_option ( 'gads_dash_apikey', '' ); 
  30. delete_option ( 'gads_dash_clientid', '' ); 
  31. delete_option ( 'gads_dash_clientsecret', '' );