[wp-hackers] Why do some user meta entries use the table prefix in the meta key?

David Anderson david at wordshell.net
Mon May 13 09:21:57 UTC 2013


On 13/05/13 10:04, David Anderson wrote:
>> The reason it's like this is to support entries which can have
>> different values on different sites in a Multisite network. For
>> example, in Multisite a user can have different privileges on
>> different sites within the network. Each site has its own database
>> prefix (wp_1_, wp_2_... wp_n_) and the user meta key is based off of
>> this.
> I don't get this.... as long as all the sites within the network are
> still using the same database and table prefix, then the meta key
> prefix is still an invariant, isn't it? i.e. It only provides
> something useful if the different sites within the network are
> actually using a different table prefix. Otherwise, the same effect
> could be achieved by just using a fixed string instead of the
> $table_prefix setting. Or am I missing something?

I could have been clearer here. I understand the need for the blog ID 
1_, 2_ to vary. It's the reason for including the apparently invariant 
wp_ that I'm not clear on.

David

-- 
WordShell - WordPress fast from the CLI - www.wordshell.net



More information about the wp-hackers mailing list