XML-RPC in WordPress 3.4

WordPress 3.4 has finally hit beta! Since full changelog/release notes are not yet available, I want to recap the improvements in XML-RPC functionality for this release here.

New Methods

The most significant change was the addition of a suite of new methods covering post and taxonomy functionality.

These replace the legacy metaWeblog API methods for creating and editing posts, which did not support custom post types or taxonomies. You should no longer need to use any non-wp.* methods, please use the WordPress API in all of your apps and integrations!

Bugfixes

Fortunately, most of the items from my bugs hitlist have been fixed this cycle.

One of the most requested was #15098, support for adding a featured image/thumbnail to posts. This has been added to both the new post methods and the legacy metaWeblog post methods. Now the mobile apps can finally support post thumbnails, a long-requested feature by mobile users.

Check out the full list of XML-RPC tickets from this cycle.

Unit Tests

The WordPress core team takes backwards compatibility very seriously, and that’s even more important for a public/external API like XML-RPC. The best way to protect against breaking API changes is to have a robust test suite for it. One of the commit bars for this cycle was that core patches needed corresponding unit tests.

The core unit test suite now includes 134 XML-RPC tests, covering 631 assertions. While this is a large step forward, it’s hopefully just the beginning.

Documentation

Having written XML-RPC clients in Python, C#, and Java for talking to WordPress, I’ve banged my head against the vagaries of the WordPress XML-RPC API many many times. A large part of this is because there has been a dearth of documentation on the specifics of method parameters and return values.

Although WordPress ostensibly implements “standard” APIs (Blogger, metaWeblog, and MovableType), the specs for those APIs have largely disappeared from the internet, and WordPress has expanded or modified them to cover WordPress-specific features. This makes life difficult for developers who don’t want to dive into WordPress core code.

Over the past several months, I’ve been documenting the entirety of the XML-RPC API, including all of the legacy methods. For now you can find it on my Codex userpage, but I hope to work with the Codex team to get it onto the “real” Codex before the final 3.4 release. Update: Now on the Codex!

Conclusion

Between support for custom post types, custom taxonomies, post thumbnails, and all of the other bugfixes, the XML-RPC API has made significant strides forward this release. This has opened the door for the official mobile apps to become more capable, as well as enable new scenarios for other external services and API consumers.

I’d like to thank Peter Westwood (aka westi) for being our fearless leader and carving time out of his busy schedule to mentor Marko Heijnen and I this cycle. Thanks also to Joseph Scott for helping to drive the bugfix work at the beginning of the cycle. And thanks to Andrew Nacin and Ryan Boren for their support and beating the security drum.

If anyone finds bugs, please report them! Once 3.4 is out the door, we’ll talk about scope for 3.5, and I have several ideas on where XML-RPC can head in future releases. Especially if core is serious about adopting a REST(ful) API like the one being built for WordPress.com. But more on that another day!

12 Responses to XML-RPC in WordPress 3.4
  1. [...] custom content types and taxonomies, check out the Codex page, put together by Max Cutler. Max also reca... wpdevel.wordpress.com/2012/06/07/wordpress-3-4-field-guide-for-developers
  2. Isaac Keyet

    Amazing work, Max. Really looking forward to being able to use these endpoints and the improved API.

  3. [...] custom content types and taxonomies, check out the Codex page, put together by Max Cutler. Max also reca... wpfreedomthemes.com/links-post
  4. [...] Zcela přepracováno bylo také XML-RPC WordPress API, nově už počítá s custom post types a custom ... seo-konzultant.cz/pripravte-se-na-wordpress-3-4
  5. Zach

    This is great, Max! Thank you for sharing. I found another relevant article that talks about other things you can do to avoid website errors while upgrading. http://bit.ly/McXRqb – I hope this is of use.

  6. [...] The new XML-RPC API for mobile and external apps is hot. Superceding the older XML-RPC Support for Blogg... lorelle.wordpress.com/2012/06/15/wordpress-3-4-green-is-good-to-go
  7. [...] Para mas Informacion:http://www.maxcutler.com/2012/04/04/xml-rpc-in-wordpress-3-4/ [...]... tutosytips.com/hablemos-de-la-nueva-version-de-wordpress-la-3-4-green
  8. [...] Max Cutler on XML-RPC in 3.4  Posted by jblum at 3:59 pm [...]... wordpress.blogs.wp.horizon.ac.uk/3-4-upgrade-case
  9. maxhodges

    Is there any documentation on how to use this new property?

    I passed the ID to a media library object (image/jpeg) and it’s creating the post, but not setting the thumbnail. The image exists in the media lib but it’s unattached. Is that OK?

  10. maxhodges

    arrrg! this ticket is misleading!
    http://core.trac.wordpress.org/ticket/20396

    it’s “wp_post_thumbnail” not “post_thumbnail”

Leave a Reply