0

I'm using R to upload posts onto Wordpress using XML-RPC using the newPost function from the RWordpress package.

The function call I'm using is:

newPost(
    content = list(
        description = postContent, 
        title = ttl, 
        categories = category_desc, 
        mt_keywords = keywords
    ), 
    publish = TRUE
)

I've just created custom taxonomies for my posts but am unsure how to tag those within the function call. Can anyone please advise?

For example, I have a custom taxonomy named "Monkey Type". I want to be able to tag it under the term name "Chimpanzee". Understand that the newPost() function uses metaWeblog.newPost. wp.newPost allows tagging of posts to custom taxonomies through the terms and terms names parameter but I'm unsure how to supply the relevant struct in R.

  • For example, I have a custom taxonomy named "Monkey Type". I want to be able to tag it under the term name "Chimpanzee". Understand that the newPost() function uses metaWeblog.newPost. wp.newPost allows tagging of posts to custom taxonomies through the terms and terms names parameter but i'm unsure how to supply the relevant struct in R – Clement Tan Jul 14 '17 at 5:40
0

It looks like custom taxonomies aren't supported by metaWeblog.newPost.

For self-hosted WordPress installs, one could try to use this hook, to adjust the tagging of posts added with metaWeblog.newPost:

/**
 * Fires after a new post has been successfully created via the XML-RPC MovableType API.
 *
 * @since 3.4.0
 *
 * @param int   $post_ID ID of the new post.
 * @param array $args    An array of arguments to create the new post.
 */
 do_action( 'xmlrpc_call_success_mw_newPost', $post_ID, $args );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.