http://kktzf.com.cn/wiki/history/WordPress:UnMuify_the_plugin_shared_tables?feed=atom精品欧洲av无码一区二区,精品久久久无码人妻中文字幕2025-07-05T15:28:31Z本wiki上該頁面的版本歷史MediaWiki 1.39.3http://kktzf.com.cn/wiki/WordPress:UnMuify_the_plugin_shared_tables?diff=11717&oldid=prevXxf3325:?新頁面: In WPMU the runtime muifys the wpdb->prefix, changing it from the default wp_ prefix to wp_x_ where x = 1...n; as this is usually needed to convert plugins that know about a single blog t...2008-09-26T05:39:24Z<p>新頁面: In WPMU the runtime muifys the wpdb->prefix, changing it from the default wp_ prefix to wp_x_ where x = 1...n; as this is usually needed to convert plugins that know about a single blog t...</p>
<p><b>新頁面</b></p><div>In WPMU the runtime muifys the wpdb->prefix, changing it from the default wp_ prefix to wp_x_ where x = 1...n; as this is usually needed to convert plugins that know about a single blog to one that can deal with many.<br />
<br />
This normally works fine, but causes issues where a plugin actually wants a global table, not a per blog one.<br />
<br />
If you need a plugin to use a global table, then you could either modify the plugin's code to use $wpmuBaseTablePrefix (which is the base table prefix, probably wp_) or you can possibly add lines similar to these at the start and end of the plugin files rather than editing all the code inline:<br />
<br />
<pre><br />
<?php<br />
$normal_table_prefix = $table_prefix; // grab for later<br />
$table_prefix = $wpmuBaseTablePrefix; // setting to global base<br />
$wpdb->prefix = $wpmuBaseTablePrefix; // setting to glboal base<br />
<br />
<br />
// ... all the plugin code here<br />
<br />
<br />
$table_prefix = $normal_table_prefix; // back to what it was<br />
$wpdb->prefix = $normal_table_prefix; // back to what it was<br />
unset($normal_table_prefix); // and we're done with this now<br />
?><br />
</pre></div>Xxf3325