Reputation: 117
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' , '[email protected]', '');
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 , '');
Upvotes: 0
Views: 370
Reputation: 21
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
Upvotes: 2