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
This commit is contained in:
duck_ 2012-03-05 17:39:26 +00:00
parent b53c996068
commit 3385cbbd6f
1 changed files with 3 additions and 3 deletions

View File

@ -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();