Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update posts using knit2wp

I have been able to successfully post to WordPress using knit2wp, even with images.

Even possessing such talent, I am not infallible. Indeed, even the above took some work.

I'd like to be able to update posts later.

Apparently, the RWordPress package allows for deletion of posts, but that doesn't help much if one cannot read the metadata of a post, delete it, post a new post, and update the metadata … and I do not offhand see an option or function to just update a post.

Any and all suggestions welcome. Thank you.

like image 323
Rolf Marvin Bøe Lindgren Avatar asked Nov 01 '22 08:11

Rolf Marvin Bøe Lindgren


2 Answers

As you've alluded to, the RWordPress package in R does not support editing of posts. RWordPress uses the XML-RPC interface to interface with Wordpress however, so you'd need to either:

  1. Find another R package that does allow editing
  2. Extend RWordPress to support the wp.editPost XML-RPC method. This was only added in WP 3.4 which was released in June 2012. RWordPress was last update August 2012 so it doesn't surprise me that it doesn't support it yet - perhaps the package has been abandoned?

You can read more about the WordPress XML-RPC methods in the WordPress Codex: http://codex.wordpress.org/XML-RPC_WordPress_API/Posts#wp.editPost

like image 127
Luke Peterson Avatar answered Nov 10 '22 05:11

Luke Peterson


The most recent version of knit2wp supports editing of posts. Case closed.

like image 35
Rolf Marvin Bøe Lindgren Avatar answered Nov 10 '22 06:11

Rolf Marvin Bøe Lindgren