Changeset 2487 for trunk/wp-admin/upgrade-functions.php
- Timestamp:
- 03/29/2005 05:34:30 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upgrade-functions.php
r2451 r2487 181 181 } 182 182 183 if ( !is_array( get_settings('active_plugins') ) ) { 184 $plugins = explode("\n", trim(get_settings('active_plugins')) ); 185 update_option('active_plugins', $plugins); 186 } 183 $active_plugins = __get_option('active_plugins'); 184 185 // If plugins are not stored in an array, they're stored in the old 186 // newline separated format. Convert to new format. 187 if ( !is_array( $active_plugins ) ) { 188 $active_plugins = explode("\n", trim($active_plugins)); 189 update_option('active_plugins', $active_plugins); 190 } 187 191 188 192 // Obsolete tables … … 290 294 } 291 295 return $all_options; 296 } 297 298 // Version of get_option that is private to install/upgrade. 299 function __get_option($setting) { 300 global $wpdb; 301 302 $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'"); 303 304 @ $kellogs = unserialize($option); 305 if ($kellogs !== FALSE) 306 return $kellogs; 307 else 308 return $option; 292 309 } 293 310 … … 562 579 if ($lines) { 563 580 $f = fopen("$site_dir/$newfile", 'w'); 564 581 582 $siteurl = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'"); 565 583 foreach ($lines as $line) { 566 584 if (preg_match('/require.*wp-blog-header/', $line)) … … 568 586 569 587 // Update stylesheet references. 570 $line = str_replace("<?php echo get_settings('siteurl'); ?>/wp-layout.css", "<?php bloginfo('stylesheet_url'); ?>", $line);588 $line = str_replace("<?php echo $siteurl; ?>/wp-layout.css", "<?php bloginfo('stylesheet_url'); ?>", $line); 571 589 572 590 // Update comments template inclusion. … … 580 598 581 599 // Add a theme header. 582 $header = "/*\nTheme Name: $theme_name\nTheme URI: " . get_option('siteurl') . "\nDescription: A theme automatically created by the upgrade.\nVersion: 1.0\nAuthor: Moi\n*/\n";600 $header = "/*\nTheme Name: $theme_name\nTheme URI: " . __get_option('siteurl') . "\nDescription: A theme automatically created by the upgrade.\nVersion: 1.0\nAuthor: Moi\n*/\n"; 583 601 584 602 $stylelines = file_get_contents("$site_dir/style.css"); … … 619 637 foreach ($stylelines as $line) { 620 638 if (strstr($line, "Theme Name:")) $line = "Theme Name: $theme_name"; 621 elseif (strstr($line, "Theme URI:")) $line = "Theme URI: " . get_option('siteurl');639 elseif (strstr($line, "Theme URI:")) $line = "Theme URI: " . __get_option('siteurl'); 622 640 elseif (strstr($line, "Description:")) $line = "Description: Your theme"; 623 641 elseif (strstr($line, "Version:")) $line = "Version: 1"; … … 649 667 function make_site_theme() { 650 668 // Name the theme after the blog. 651 $theme_name = get_option('blogname');669 $theme_name = __get_option('blogname'); 652 670 $template = sanitize_title($theme_name); 653 671 $site_dir = ABSPATH . "wp-content/themes/$template"; … … 680 698 681 699 // Make the new site theme active. 682 $current_template = get_option('template');700 $current_template = __get_option('template'); 683 701 if ($current_template == 'default') { 684 702 update_option('template', $template);
Note: See TracChangeset
for help on using the changeset viewer.