Here’s my call:
result = blog.call('wp.newPost',
1,
'user',
'pw',
{
'post_type' => 'post',
'post_content' => entry[3],
'post_name' => entry[2].downcase.split(" ").join("-"),
'comment_status' => 'closed',
'pinged' => 'closed',
'post_status' => 'publish',
'post_title' => entry[2],
'terms' => ['category' => 9]
})
This is returning an error that this post type post doesn’t support one of the taxonomies given category – well, every post should have a category, so I’m thinking that my ruby is malformed. The API asks for an array with the taxonomy as a key and its ID as the value, which I think I’ve done here.
This is for v3.4 – here is the documentation on wp.newPost
Interestingly enough, the following code worked:
This converted (via the XMLRPC Writer) to the appropriate XML and registered the posts in WordPress. Turning on the XML-RPC debugging information revealed that a struct wasn’t being passed unless the variable
9was enclosed in brackets, even though it is a single value array.