2012-02-28 7 views
1

mySQlデータベースにデータを直接挿入することで、MultiSiteを押すことができます。私はインターネット上のすべてを見ているが、これを実装する運がなかった。Wordpress Multi-Site - プログラムでユーザーを作成する

Wordpress Multi Site (Networking enabled)同様の質問であるようですが、そこに提供されているソリューションを実装することはできません。誰でもこれを実装するための基礎を助けることができますか?

おかげ

答えて

1

あなたは以下のmulti-site.Hereに新しいパスで新しいブログを作成するための単一のメソッド呼び出しを行う必要がありWordPressのマルチサイトのプラグインhere。あなたが使用する必要がありますApacheのXML-RPC APIを使用する例であります

public class Demo 
{ 
    public static void main(String[] args) 
    { 
    System.out.println("Starting adicXmlRpcServer test"); 

    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); 
    try 
    { 
     config.setServerURL(new URL("http://localhost/wordpress/xmlrpc.php")); 
    } 
    catch (MalformedURLException ex) 
    { 
     System.out.println("Invalid url....."+ex.getMessage()); 
     ex.printStackTrace(); 
    } 

    XmlRpcClient client = new XmlRpcClient(); 
    client.setConfig(config); 
    Map map = new HashMap(); 
    map.put("domain","localhost"); 
    map.put("path","/newStrore"); 
    map.put("title","newStrore"); 
    map.put("user_id","[email protected]"); 

    Object[] params = new Object[] {new String("admin"),new String("9868"),map}; 

    try 
    { 
     Object result = (Object) client.execute("ms.CreateBlog",params); 
     ArrayList<String> dirListing = new ArrayList<String>(); 
     System.out.println(result.toString()); 
    } 
    catch (XmlRpcException ex) 
    { 
     System.out.println("Invalid url....."+ex.getMessage()); 
     ex.printStackTrace(); 
    } 
    } 
} 
関連する問題