380 'mailserver_port' => 110, |
375 'mailserver_port' => 110, |
381 'default_category' => 1, |
376 'default_category' => 1, |
382 'default_comment_status' => 'open', |
377 'default_comment_status' => 'open', |
383 'default_ping_status' => 'open', |
378 'default_ping_status' => 'open', |
384 'default_pingback_flag' => 1, |
379 'default_pingback_flag' => 1, |
385 'default_post_edit_rows' => 20, |
|
386 'posts_per_page' => 10, |
380 'posts_per_page' => 10, |
387 /* translators: default date format, see http://php.net/date */ |
381 /* translators: default date format, see http://php.net/date */ |
388 'date_format' => __('F j, Y'), |
382 'date_format' => __('F j, Y'), |
389 /* translators: default time format, see http://php.net/date */ |
383 /* translators: default time format, see http://php.net/date */ |
390 'time_format' => __('g:i a'), |
384 'time_format' => __('g:i a'), |
473 'uninstall_plugins' => array(), |
465 'uninstall_plugins' => array(), |
474 |
466 |
475 // 2.8 |
467 // 2.8 |
476 'timezone_string' => $timezone_string, |
468 'timezone_string' => $timezone_string, |
477 |
469 |
478 // 2.9 |
|
479 'embed_autourls' => 1, |
|
480 'embed_size_w' => '', |
|
481 'embed_size_h' => 600, |
|
482 |
|
483 // 3.0 |
470 // 3.0 |
484 'page_for_posts' => 0, |
471 'page_for_posts' => 0, |
485 'page_on_front' => 0, |
472 'page_on_front' => 0, |
486 |
473 |
487 // 3.1 |
474 // 3.1 |
488 'default_post_format' => 0, |
475 'default_post_format' => 0, |
|
476 |
|
477 // 3.5 |
|
478 'link_manager_enabled' => 0, |
489 ); |
479 ); |
490 |
480 |
491 // 3.3 |
481 // 3.3 |
492 if ( ! is_multisite() ) { |
482 if ( ! is_multisite() ) { |
493 $options['initial_db_version'] = ! empty( $wp_current_db_version ) && $wp_current_db_version < $wp_db_version |
483 $options['initial_db_version'] = ! empty( $wp_current_db_version ) && $wp_current_db_version < $wp_db_version |
529 |
519 |
530 // in case it is set, but blank, update "home" |
520 // in case it is set, but blank, update "home" |
531 if ( !__get_option('home') ) update_option('home', $guessurl); |
521 if ( !__get_option('home') ) update_option('home', $guessurl); |
532 |
522 |
533 // Delete unused options |
523 // Delete unused options |
534 $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page', 'wporg_popular_tags', 'what_to_show', 'rss_language'); |
524 $unusedoptions = array( |
|
525 'blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', |
|
526 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', |
|
527 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', |
|
528 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', |
|
529 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', |
|
530 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', |
|
531 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', |
|
532 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', |
|
533 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', |
|
534 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', |
|
535 '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', |
|
536 'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', |
|
537 'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page', |
|
538 'wporg_popular_tags', 'what_to_show', 'rss_language', 'language', 'enable_xmlrpc', 'enable_app', |
|
539 'autoembed_urls', 'default_post_edit_rows', |
|
540 ); |
535 foreach ( $unusedoptions as $option ) |
541 foreach ( $unusedoptions as $option ) |
536 delete_option($option); |
542 delete_option($option); |
537 |
543 |
538 // delete obsolete magpie stuff |
544 // delete obsolete magpie stuff |
539 $wpdb->query("DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'"); |
545 $wpdb->query("DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'"); |
896 'welcome_email' => $welcome_email, |
906 'welcome_email' => $welcome_email, |
897 'first_post' => __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' ), |
907 'first_post' => __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' ), |
898 // @todo - network admins should have a method of editing the network siteurl (used for cookie hash) |
908 // @todo - network admins should have a method of editing the network siteurl (used for cookie hash) |
899 'siteurl' => get_option( 'siteurl' ) . '/', |
909 'siteurl' => get_option( 'siteurl' ) . '/', |
900 'add_new_users' => '0', |
910 'add_new_users' => '0', |
901 'upload_space_check_disabled' => '0', |
911 'upload_space_check_disabled' => is_multisite() ? get_site_option( 'upload_space_check_disabled' ) : '1', |
902 'subdomain_install' => intval( $subdomain_install ), |
912 'subdomain_install' => intval( $subdomain_install ), |
903 'global_terms_enabled' => global_terms_enabled() ? '1' : '0', |
913 'global_terms_enabled' => global_terms_enabled() ? '1' : '0', |
|
914 'ms_files_rewriting' => is_multisite() ? get_site_option( 'ms_files_rewriting' ) : '0', |
904 'initial_db_version' => get_option( 'initial_db_version' ), |
915 'initial_db_version' => get_option( 'initial_db_version' ), |
905 'active_sitewide_plugins' => array(), |
916 'active_sitewide_plugins' => array(), |
|
917 'WPLANG' => get_locale(), |
906 ); |
918 ); |
907 if ( ! $subdomain_install ) |
919 if ( ! $subdomain_install ) |
908 $sitemeta['illegal_names'][] = 'blog'; |
920 $sitemeta['illegal_names'][] = 'blog'; |
909 |
921 |
910 $insert = ''; |
922 $insert = ''; |
917 $insert .= ', '; |
929 $insert .= ', '; |
918 $insert .= "( $network_id, '$meta_key', '$meta_value')"; |
930 $insert .= "( $network_id, '$meta_key', '$meta_value')"; |
919 } |
931 } |
920 $wpdb->query( "INSERT INTO $wpdb->sitemeta ( site_id, meta_key, meta_value ) VALUES " . $insert ); |
932 $wpdb->query( "INSERT INTO $wpdb->sitemeta ( site_id, meta_key, meta_value ) VALUES " . $insert ); |
921 |
933 |
922 $current_site->domain = $domain; |
934 // When upgrading from single to multisite, assume the current site will become the main site of the network. |
923 $current_site->path = $path; |
935 // When using populate_network() to create another network in an existing multisite environment, |
924 $current_site->site_name = ucfirst( $domain ); |
936 // skip these steps since the main site of the new network has not yet been created. |
925 |
937 if ( ! is_multisite() ) { |
926 if ( !is_multisite() ) { |
938 $current_site = new stdClass; |
|
939 $current_site->domain = $domain; |
|
940 $current_site->path = $path; |
|
941 $current_site->site_name = ucfirst( $domain ); |
927 $wpdb->insert( $wpdb->blogs, array( 'site_id' => $network_id, 'domain' => $domain, 'path' => $path, 'registered' => current_time( 'mysql' ) ) ); |
942 $wpdb->insert( $wpdb->blogs, array( 'site_id' => $network_id, 'domain' => $domain, 'path' => $path, 'registered' => current_time( 'mysql' ) ) ); |
928 $blog_id = $wpdb->insert_id; |
943 $current_site->blog_id = $blog_id = $wpdb->insert_id; |
929 update_user_meta( $site_user->ID, 'source_domain', $domain ); |
944 update_user_meta( $site_user->ID, 'source_domain', $domain ); |
930 update_user_meta( $site_user->ID, 'primary_blog', $blog_id ); |
945 update_user_meta( $site_user->ID, 'primary_blog', $blog_id ); |
931 if ( !$upload_path = get_option( 'upload_path' ) ) { |
946 |
932 $upload_path = substr( WP_CONTENT_DIR, strlen( ABSPATH ) ) . '/uploads'; |
947 if ( $subdomain_install ) |
933 update_option( 'upload_path', $upload_path ); |
948 $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); |
934 } |
949 else |
935 update_option( 'fileupload_url', get_option( 'siteurl' ) . '/' . $upload_path ); |
950 $wp_rewrite->set_permalink_structure( '/blog/%year%/%monthnum%/%day%/%postname%/' ); |
936 } |
951 |
937 |
952 flush_rewrite_rules(); |
938 if ( $subdomain_install ) |
953 } |
939 $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); |
|
940 else |
|
941 $wp_rewrite->set_permalink_structure( '/blog/%year%/%monthnum%/%day%/%postname%/' ); |
|
942 |
|
943 flush_rewrite_rules(); |
|
944 |
954 |
945 if ( $subdomain_install ) { |
955 if ( $subdomain_install ) { |
946 $vhost_ok = false; |
956 $vhost_ok = false; |
947 $errstr = ''; |
957 $errstr = ''; |
948 $hostname = substr( md5( time() ), 0, 6 ) . '.' . $domain; // Very random hostname! |
958 $hostname = substr( md5( time() ), 0, 6 ) . '.' . $domain; // Very random hostname! |