gglstmp_check_old_options

The Google Sitemap by BestWebSoft gglstmp check old options function.

Description

gglstmp_check_old_options(); 

Usage

  1. if ( !function_exists( 'gglstmp_check_old_options' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-sitemap-by-bestwebsoft/includes/deprecated.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = gglstmp_check_old_options(); 
  7.  

Defined (1)

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

/includes/deprecated.php  
  1. function gglstmp_check_old_options() { 
  2. if ( is_multisite() ) { 
  3. global $wpdb; 
  4. if ( get_site_option( 'gglstmp_settings' ) ) { 
  5. $old_options = get_site_option( 'gglstmp_settings' ); 
  6. if ( ! get_site_option( 'gglstmp_options' ) ) 
  7. add_site_option( 'gglstmp_options', $old_options ); 
  8. else 
  9. update_site_option( 'gglstmp_options', $old_options ); 
  10. delete_site_option( 'gglstmp_settings' ); 
  11. $blogids = $wpdb->get_col( "SELECT `blog_id` FROM $wpdb->blogs" ); 
  12. $old_blog = $wpdb->blogid; 
  13. foreach ( $blogids as $blog_id ) { 
  14. switch_to_blog( $blog_id ); 
  15. if ( get_option( 'gglstmp_settings' ) ) { 
  16. $old_options = get_option( 'gglstmp_settings' ); 
  17. if ( ! get_option( 'gglstmp_options' ) ) 
  18. add_option( 'gglstmp_options', $old_options ); 
  19. else 
  20. update_option( 'gglstmp_options', $old_options ); 
  21. delete_option( 'gglstmp_settings' ); 
  22. switch_to_blog( $old_blog ); 
  23. } else { 
  24. if ( get_option( 'gglstmp_settings' ) ) { 
  25. $old_options = get_option( 'gglstmp_settings' ); 
  26. if ( ! get_option( 'gglstmp_options' ) ) 
  27. add_option( 'gglstmp_options', $old_options ); 
  28. else 
  29. update_option( 'gglstmp_options', $old_options ); 
  30. delete_option( 'gglstmp_settings' );