0

I want to make a new blog in php code.

Blog is created, but is disabled or not available.

I've even set options but still not active blog.

No example of how to create a blog by WPMU found on the Internet

my code:

function createweblog($domain, $path, $title, $user_id, $meta){

$id= wpmu_create_blog($domain, $path, $title, $user_id, '');
if($id > 1)
{
    wpmu_signup_blog($domain, $path, $title, 'adminuser' , 'adminemail@gmail.com', '');
    update_blog_option ($id,'blogdescription', 'description of new blog');
    update_blog_option ($id, 'blog_public', 1);
    return $id;
}
}

$blog_id = createweblog('subdomain.', 'domain.com', 'title of new blog' , 1 , '');
Admin File3
  • 119
  • 10

1 Answers1

2

Use wpmu_create_blog instead if just like to create the blog. For further info: https://wordpress.stackexchange.com/questions/167356/creating-multisite-in-wordpress-using-php and https://phpxref.ftwr.co.uk/wordpress/nav.html?wp-includes/ms-functions.php.html

klint
  • 21
  • 2