要创建基本插件,请在中添加目录wp-content/plugin
, 然后用required header, 就这样。
现在,下面是如何使用该操作:
add_action( \'wpmu_new_blog\', \'user16975_customize_blog\', 10, 6);
function user16975_customize_blog($blog_id, $user_id, $domain, $path, $site_id, $meta ){
// do not forget to select the correct blog (we are in mutisite admin)
switch_to_blog($blog_id);
// You can retrieve the register information in $_POST var, depending on your registration form
// change the blog name
update_option(\'blogname\', \'M&F Lastname\');
// change the blog address
$newurl = esc_url( \'http://\' . $domain . \'m&f-lastname\' );
update_option( \'siteurl\', $newurl );
update_option( \'home\', $newurl );
// rename the default article
wp_update_post(array(
\'ID\' => 1,
\'post_title\' => \'Long live the newlyweds!\',
\'post_name\' => \'long-live-the-newlyweds\'
));
restore_current_blog();
}
因此,剩下的部分是定制您的注册表。您使用什么表格注册新用户?如果您使用的是前端注册表,则可以使用
signup_blogform
行动