evolve_migrate_options

The evolve evolve migrate options function.

Description

evolve_migrate_options(); 

Usage

  1. if ( !function_exists( 'evolve_migrate_options' ) ) { 
  2. require_once '/library/admin/options-init.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = evolve_migrate_options(); 
  7.  

Defined (1)

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

/library/admin/options-init.php  
  1. function evolve_migrate_options() { 
  2. global $evolve_shortname, $evolve_opt_name; 
  3. $migrate_done = get_option('evl_33_migrate', false); 
  4. if ($migrate_done !== 'done') { 
  5. $newData = get_option('evl_options', false); 
  6. if (empty($newData)) { 
  7. $config = get_option('evolve'); 
  8. if (isset($config['id'])) { 
  9. $oldData = get_option($config['id'], array()); 
  10. if (!empty($oldData)) { 
  11. foreach ($oldData as $key => $value) { 
  12. $fontKeys = array( 
  13. 'evl_bootstrap_slide_subtitle_font',  
  14. 'evl_bootstrap_slide_title_font',  
  15. 'evl_carousel_slide_subtitle_font',  
  16. 'evl_carousel_slide_title_font',  
  17. 'evl_content_font',  
  18. 'evl_content_h1_font',  
  19. 'evl_content_h2_font',  
  20. 'evl_content_h3_font',  
  21. 'evl_content_h4_font',  
  22. 'evl_content_h5_font',  
  23. 'evl_content_h6_font',  
  24. 'evl_menu_font',  
  25. 'evl_parallax_slide_subtitle_font',  
  26. 'evl_parallax_slide_title_font',  
  27. 'evl_post_font',  
  28. 'evl_tagline_font',  
  29. 'evl_title_font',  
  30. 'evl_widget_content_font',  
  31. 'evl_widget_title_font',  
  32. ); 
  33. $mediaKeys = array( 
  34. 'evl_bootstrap_slide1_img',  
  35. 'evl_bootstrap_slide2_img',  
  36. 'evl_bootstrap_slide3_img',  
  37. 'evl_bootstrap_slide4_img',  
  38. 'evl_bootstrap_slide5_img',  
  39. 'evl_content_background_image',  
  40. 'evl_favicon',  
  41. 'evl_footer_background_image',  
  42. 'evl_header_logo',  
  43. 'evl_scheme_background',  
  44. 'evl_slide1_img',  
  45. 'evl_slide2_img',  
  46. 'evl_slide3_img',  
  47. 'evl_slide4_img',  
  48. 'evl_slide5_img',  
  49. ); 
  50. // Typography SHIM 
  51. if (in_array($key, $fontKeys)) { 
  52. if (isset($value['size'])) { 
  53. $value['font-size'] = $value['size']; 
  54. unset($value['size']); 
  55. if (isset($value['face'])) { 
  56. $value['font-family'] = $value['face']; 
  57. unset($value['face']); 
  58. if (isset($value['style'])) { 
  59. $value['font-style'] = $value['style']; 
  60. unset($value['style']); 
  61. $oldData[$key] = $value; 
  62. } elseif (in_array($key, $mediaKeys)) { 
  63. $oldData[$key] = array('url' => isset($value) ? $value : ''); 
  64.  
  65. update_option($evolve_opt_name, $oldData); 
  66. update_option('evl_33_migrate', 'done');