WordPress XML-RPC Fixes for ecto


Update: There is a patch for the WordPress 1.2 version of the xmlrpc.php file that fixes this and a bunch of other things. You can find the patch here.

As usual, this is unsupported by WordPress, Ecto and me.

Note: This post has been updated numerous times, now. I keep all these updates here instead of adding new posts all the time. This way, people can find it always at the same place.

WordPress 1.2 delta and ecto play well together – if you carefully educate the former to accept and work with the latter’s XML-RPC requests.

In my case (WordPress 1.2 delta, Ecto 1.1.4), I had to modify the xmlrpc.php file in order to sanitize the post_content and post_excerpt variables for the MySQL requests.

While I was at it, I also put some archaic support for the Markdown plugin into the xmlrpc.php file. This way, ecto will process your post entry through Markdown when previewing.


I managed to get the mt.getRecentPostTitlesfunction working as well. The patch file will now fix the following:

  • Sanitize the post_content and post_excerpt variables for the MySQL requests* Post with ecto to WordPress through the MovableType API* Return the status of the WordPress 1.2 Markdown plugin

This allows you to preview an entry in ecto as it will look in WordPress* A fixed mt.getRecentPostTitles will allow you to retrieve Title and Summary of the most recent entries in ecto.

You’ll have to check Retrieve titles and summaries only in ecto’s Recent Entries preferences for that. (Obsolete if you use the full patch below)

Here’s the xmlrpc.patch you apply to xmlrpc.php in order to fix XML-RPC.


There was some more stuff it put into a patch, notably

  • Get full posts via metaWeblog.getRecentPosts

There was an incompatibility between the way WP stored multiple categories per entry in its database and how the xmlrpc.php retrieved categories. This led to empty category array strings that made ecto choke. * Remove category' in themetaWeblog.getPost’ answer.

This way, ecto will fetch the categories of a post via the `mt.getPostCategories’. Could probably be fixed otherwise.* Return the status of the Markdown plugin when retrieving a post.

Presumably cures ecto adding empty lines to the source of a post.* Change the permalink and link format.

Instead of using post_permalink(), I use get_permalink() that will return the links based on the actual blog settings. Mainly cosmetic.

This full patch, including all the changes until now, is available as xmlrpc-full.patch. Apply it to xmlrpc.php in order to fix XML-RPC.


No comments. Be the first to add one!
Add a comment.
We'll never share your email with anyone else. We use the Gravatar system to pull in pictures based on an anonymous hash.
Once you submit your comment, it will be moderated and then show up here shortly after.