Update posts using knit2wp

醉酒当歌 提交于 2019-12-07 05:02:19

问题


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.


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/20614604/update-posts-using-knit2wp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!