WPmu - How to create a new blog in php ?

milosz

Newbie
Joined
Oct 23, 2008
Messages
2
Reaction score
0
hello,
i've just installed WPmu.

i understand how to create new posts (via xml-rpc.php) : it's very easy.

is there a way to create new blogs via xml-rpc.php or something like that ?
 
naa thats only for posting content
 
i have created /wp-admin/backdoor.php (copy-paste from /wp-admin/wpmu-edit.php with little changes).

not secure, but seems to work for me.
create new blog for user "admin"

PHP:
require_once('admin.php');
do_action('wpmuadminedit', '');
		
$domain = $_GET['domain'];
$email = $_GET['email'];
$title = $_GET['title'];
$public = 1;
		
		
//$domain = 'blog1';
//$email = '[email protected]';
//$title = 'Blog1 title';
//$public = 0;
		
$user_id = email_exists($email);
		
if( constant('VHOST') == 'yes' ) {
			$newdomain = $domain.".".$current_site->domain;
			$path = $base;
		} else {
			$newdomain = $current_site->domain;
			$path = $base.$domain.'/';
		}

$domain = strtolower( $domain );
$newdomain = strtolower( $newdomain );
$path = strtolower( $path );
		
$id = wpmu_create_blog($newdomain, $path, $title, $user_id , $public, $current_site->id);

if( get_user_option( $user_id, 'primary_blog' ) == 1 )
	update_user_option( $user_id, 'primary_blog', $id, true );
 
Back
Top