While blogroll (link) management in the Wordpress admin GUI is pretty straightforward, I still find it incredibly slow when needing to wipe out links and add some completely new. Well, to be honest, what slows things down is actually
- finding the loginid and password for the blog
- logging in
- clicking to blogroll part of admin gui
It’s ok to do it if you have, say, 5 blogs, but if you like me manages around 20 or more then it gets SOOO frustrating.
Remote management for posts and categories in multiple blogs scenarios is not a problem cause XMLRPC allows us to create our own client application. There are a lot of blog clients available, but I like to do things my way, so I have actually written my own. However,next step was to find a way to manage the blogrolls remotely. Since there is no built in support in WP XMLRPC for it I simply decided to write my own. It’s implemented as a regular WP plugin - so all you need to do is download the zip file, unzip it, upload it to your plugins directory and from your WP admin pages you activate it.
I won’t give you much info on how to use it in this particular post - you do need some XMLRPC experience - I will get back with info on how to use it from a more userfriendly perspective, for now I just want to publish it and therefore I assume the php function headers will be enough for you to understand how to build up the XMLRPC call:
wpLinkMentor.getLinks
$blog_ID = (int)$args[0];
$user_login = $args[1];
$user_pass = $args[2];
$cat_id = $args[3];
you just send in an category ID (numeric). I *think* that in a typical clean install of Wordpress then the blogroll will
have ID 2. This means you can use it to manage links for ANY category in your blog.
Returns an array of links - each link having
link_id
link_url
link_title
link_description
link_visible
link_rel
wpLinkMentor.deleteLink
$blog_ID = (int)$args[0];
$user_login = $args[1];
$user_pass = $args[2];
$link_id = $args[3];
you just send in the link ID (numeric). In other words - you should typically first
call getLinks to retrieve all links and by that you get the link_id:s.
wpLinkMentor.updateLink
$blog_ID = (int)$args[0];
$user_login = $args[1];
$user_pass = $args[2];
$cat_id = $args[3];
$link_id = $args[4];
$link_url = $args[5];
$link_name = $args[6];
$link_description = $args[7];
$link_visible = $args[8];
$link_rel = $args[9];
If you specify “-1″ as link_id then it will create a new link, otherwise update.
Return the id of new/updated link.