Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

User talk:Ancawonka

  • WordPress Documentation Team - Know who is in charge and who to turn to
  • Guidelines - The heavenly handbook of Codex rules.
  • Styles - Documentation of the general styles of the Codex — please follow these so pages look well together.
  • Sandbox - Your experimental playground
  • Contributing - How to help out at the Codex
  • Editing - How to layout and design a Codex page
  • Codex Tasks - Things needing to be done and sign up list
Discussions on the Codex
Discussions on the Codex and Wp-docs mailing list are restricted to topics related to writing WordPress documentation. To post a question about information on an article in the Codex, use the Discussion Tab at the top of the article's page. To post a question to an individual Codex user, visit their User Page and post the question in their Discussion page. Answers will be posted on your User Discussion page. Sign all comments and discussions with four tildes (~) and it will display your name and time with a link to your User Page like this:
Fred Smith 03:07, 10 Apr 2014 (UTC)

Again, welcome and let us know how we can help you help us on the WordPress Codex.

MichaelH (talk) 15:51, 1 February 2010 (UTC)

--

Notes on Multisite

I was upgrading a site from WPMU 2.9 to WordPress 3.4.2 and have run into something really confounding. I'm trying to figure out why it happened, and maybe fix it.

Here's what I did

Installed WP 3.4.2 and turned on WPMS. On top of the database for this site, I then loaded the database from 2.9 with my 13 sites in it. Everything worked like a charm everywhere except the main site, which is getting data, such as options, from the wp_* tables instead of the wp_1* tables. In the database, the different blogs are numbered, and the wp_1 tables exist (they're our old default site). In the dashboard, we can't go screens that affect to the wp_1 tables at all - all of our settings and such go into the tables for wp_posts, wp_options, etc.

I just noticed this after we did a bunch of work on the site. The problem that finally made me look at the data was that we can't add users to the main site, and can't log in with any of the users that previously had access - but only for the main site.

I'm really curious about how this happened, and in particular about how the multi-site stuff is hooked up at the database level. How could WordPress look at the default tables, instead of the numbered ones created by MS?

This updated site also doesn't have the /blog/ appended to the front.

--

Well, it looks like it's supposed to be working this way (a small difference between WPMU and WPMS. :) )

From wp-db.php:

function get_blog_prefix( $blog_id = null ) {
		if ( is_multisite() ) {
			if ( null === $blog_id )
				$blog_id = $this->blogid;
			$blog_id = (int) $blog_id;
			if ( defined( 'MULTISITE' ) && ( 0 == $blog_id || 1 == $blog_id ) )
				return $this->base_prefix;
			else
				return $this->base_prefix . $blog_id . '_';
		} else {
			return $this->base_prefix;
		}
	}