From 3385cbbd6f5d7c7ed4b639726d603e7a156e27b6 Mon Sep 17 00:00:00 2001 From: duck_ Date: Mon, 5 Mar 2012 17:39:26 +0000 Subject: [PATCH] Use WP_Rewrite::set_permalink_structure instead of plain update_option() in populate_network(). Fixes #20174. This has the benefit of calling WP_Rewrite::init() which correctly resets the permalink_structure property of the $wp_rewrite global so that the rewrite rules generated on the next flush are correct. git-svn-id: http://svn.automattic.com/wordpress/trunk@20117 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/schema.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index ccb18245d..56ab1bd09 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -819,7 +819,7 @@ endif; * so the error code must be checked) or failure. */ function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $subdomain_install = false ) { - global $wpdb, $current_site, $wp_db_version; + global $wpdb, $current_site, $wp_db_version, $wp_rewrite; $errors = new WP_Error(); if ( '' == $domain ) @@ -936,9 +936,9 @@ We hope you enjoy your new site. Thanks! } if ( $subdomain_install ) - update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%postname%/'); + $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); else - update_option( 'permalink_structure', '/blog/%year%/%monthnum%/%day%/%postname%/'); + $wp_rewrite->set_permalink_structure( '/blog/%year%/%monthnum%/%day%/%postname%/' ); flush_rewrite_rules();