From 9e9f4ad923f3a17f2ba7d7076ebe4ac5cb4c5fe2 Mon Sep 17 00:00:00 2001 From: Jon Cave 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: https://develop.svn.wordpress.org/trunk@20117 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 ccb18245da..56ab1bd093 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();