Fix wp.getusersblogs error in Windows Live Writer after upgrading to WordPress MU 1.5.1

I have been using Microsoft Windows Live Writer to update my blogs for a while, but today I got some errors when I tried to publish a post to my newly upgraded WordPress MU 1.5.1 blog. After this error message, I got a prompt windows to ask my blog logon user name and password. I thought the upgrading changed the user information anyhow, so that I updated my logon password, and re-typed it in Live Writer. When I re-published, again saw the same error. I stopped, and then tried to view the web blog within the WLW. The same wp.getusersblogs error popped-up as I encountered during the publishing.

The following is the detailed error message:

log Server Error – Server Error -32601 Occurred server error. requested method wp.getUsersBlogs does not exist. You must correct this error before proceeding.


After I searched on the WordPress MU supporting forum, I was re-directed to a trac-ticket (http://trac.mu.wordpress.org/ticket/631) site. Then I realized the cause was the file named xmlrpc.php in MU 1.5.1 version.

To resolve this problem, open the xmlrpc.php file in your favorite web code editor, and look for the following code.

Line 94 ‘blogger.getUsersBlogs’ => ‘this:blogger_getUsersBlogs’,

You can add one line code right before it as the following:

‘wp.getUsersBlogs’=> ‘this:wp_getUsersBlogs’,

Next, go to the line 221 “* WordPress XML-RPC API”, create a new function called wp_getUserBlogs and insert before the function of wp_getPage. You can copy and paste the following lines of codes:

              * wp_getUsersBlogs 
              */ 
                 function wp_getUsersBlogs($args) { 
                         $this->escape($args); 
                         $username = $args[0]; 
                         $password = $args[1]; 
                         if (!$this->login_pass_ok($username, $password) ) 
                                 return $this->error; 
                         do_action(‘xmlrpc_call’, ‘wp.getUsersBlogs’); 
                         $user = set_current_user(0, $username); 
                         $blogs = (array) get_blogs_of_user($user->ID); 
                         $struct = array(); 
                         foreach ( $blogs as $blog ) { 
              // Don’t include blogs that aren’t hosted at wordpress.com 
                                 if ( $blog->site_id != 1 ) 
                                         continue; 
                                 $blog_id = $blog->userblog_id; 
                                 switch_to_blog($blog_id); 
                                 $is_admin = current_user_can(‘level_8′); 
                                 $struct[] = array( 
                                         ‘isAdmin’  => $is_admin, 
                                         ‘url’         => get_option(‘home’) . ‘/’, 
                                         ‘blogid’    => $blog_id, 
                                       ‘blogName’  => get_option(‘blogname’), 
                                   ‘xmlrpc’   =>get_option(‘home’). ‘/xmlrpc.php’ 
                                 ); 
                         } 
                         return $struct; 
                 } 

The new function above is the similar the function of blogger_getUsersBlogs you can find from the line 753 to line 791.

After these two changes, save your modified file of xmlrpc.php and upload it to your server. Now you should be fine with your MU 1.5.1 by using Windows Live Writer again.

If you are lazy as I am, you can download the modified xmlrpc.php from here.

Share
Tags: , , ,
If you feel this post is helpful for you, you are welcome to leave your comments here, or click the Paypal button at the right to buy me a beer :-)  

8 Responses to “Fix wp.getusersblogs error in Windows Live Writer after upgrading to WordPress MU 1.5.1”


  • Trackback - Free Internation Call >> How to make free international call

    ,..] lichao.net is other must read source on this topic,..]

    [Reply]

  • what i like about eva longoria is her super great complexion and a nice sexy body `,:

    [Reply]

  • Greatly very helpful regards, It’s my opinion the readership might possibly want way more posts of the aspect keep great work.

    [Reply]

  • Just got a Blogger account, it works good, but how do I find different users blogs I like with search. I remember there is a way, but I am not seeing it now. Thanks for your help.

    [Reply]

  • Hi there! This article could not be written much better! Reading through this post reminds me of my previous roommate! He continually kept preaching about this. I am going to send this post to him. Pretty sure he’s going to have a great read. Many thanks for sharing!

    [Reply]

  • I must express my affection for your kindness in support of men and women who must have guidance on this important idea. Your real commitment to passing the solution along had been quite advantageous and have specifically encouraged guys and women just like me to arrive at their objectives. Your amazing warm and friendly report implies a great deal to me and extremely more to my mates. Regards; from all of us.

    [Reply]

  • I'm no beauty queen, I'm just beautiful me.. She's such a? big inspiration to me. Singing things that I couldn't even say to myself. . I love you Selena.

    I? love you shakira

    [Reply]

  • In the grand design of things you actually get an A for hard work. Exactly where you actually lost me was in your specifics. You know, they say, details make or break the argument.. And it couldn’t be more correct right here. Having said that, allow me reveal to you just what did give good results. The article (parts of it) is certainly highly engaging and that is most likely the reason why I am taking an effort in order to opine. I do not make it a regular habit of doing that. Secondly, even though I can see the leaps in reasoning you come up with, I am not confident of how you seem to unite the points which in turn help to make your conclusion. For the moment I will yield to your point but trust in the future you actually link the facts better.

    [Reply]

Leave a Reply

If you feel this post is helpful for you, you are welcome to leave your comments here, or click the Paypal button at the right to buy me a beer :-)  


Get Adobe Flash playerPlugin by wpburn.com wordpress themes