请参见:How To Modify New Sub Blog Immediately When Super Administrator Creates It?
我想发布的代码很遗憾我无法发布,因为“body限制为30000个字符;您输入了62367”,所以。。。以下过滤器非常方便(来自WordPressMU插件,用于站点管理员设置新博客的默认值,Deanna Schneider):
function set_blog_defaults($blog_id, $user_id)
{
global $wp_rewrite, $wpdb, $current_site;
switch_to_blog($blog_id);
// do stuff
}
// When a new blog is created, set the options
add_action(\'wpmu_new_blog\', array(&$cets_wpmubd, \'set_blog_defaults\'), 100, 2);
?>