WordPress.org

Make WordPress Core

Changeset 20117


Ignore:
Timestamp:
03/05/2012 05:39:26 PM (9 years ago)
Author:
duck_
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/schema.php

    r20080 r20117  
    820820 */
    821821function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $subdomain_install = false ) {
    822     global $wpdb, $current_site, $wp_db_version;
     822    global $wpdb, $current_site, $wp_db_version, $wp_rewrite;
    823823
    824824    $errors = new WP_Error();
     
    937937
    938938    if ( $subdomain_install )
    939         update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%postname%/');
     939        $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
    940940    else
    941         update_option( 'permalink_structure', '/blog/%year%/%monthnum%/%day%/%postname%/');
     941        $wp_rewrite->set_permalink_structure( '/blog/%year%/%monthnum%/%day%/%postname%/' );
    942942
    943943    flush_rewrite_rules();
Note: See TracChangeset for help on using the changeset viewer.