Make WordPress Core

Ticket #12028: wpmu-create-blog.2.patch

File wpmu-create-blog.2.patch, 1.1 KB (added by jpotkanski, 15 years ago)

Patch for wpmu-functions.php

  • wp-includes/wpmu-functions.php

    # This patch file was generated by NetBeans IDE
    # This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
    # It uses platform neutral UTF-8 encoding.
    # Above lines and this line are ignored by the patching process.
    old new  
    12931293}
    12941294
    12951295function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1) {
     1296        global $wpdb, $wp_queries;
    12961297        $domain = preg_replace( "/\s+/", '', sanitize_user( $domain, true ) );
    12971298        if( constant( 'VHOST' ) == 'yes' )
    12981299                $domain = str_replace( '@', '', $domain );
     
    13141315
    13151316        switch_to_blog($blog_id);
    13161317
     1318        if($wp_queries){
     1319            $pattern = '/' . $wpdb->base_prefix . '(\d+)/';
     1320            $prefix = $wpdb->base_prefix . $blog_id;
     1321            $wp_queries = preg_replace($pattern,$prefix, $wp_queries);
     1322        }
     1323
    13171324        install_blog($blog_id, $title);
    13181325
    13191326        install_blog_defaults($blog_id, $user_id);