6

我正在使用jwordpress-0.4.jar发布到 WordPress 安装。

我正在使用的代码是:

Wordpress wp = new Wordpress(username, password, xmlRpcUrl);
Page recentPost = new Page();
recentPost.setPost_status("Published");
recentPost.setDescription("<ul>" + desc + "</ul>");
recentPost.setCategories(cat);
String pageID=recentPost.getPage_id();
String result = wp.newPost(recentPost, true);

这以前效果很好,但是现在当我去发布它进入它的调度模式时,我尝试过:

最近的Post.setPost_status(“已发布”);

wp.​​newPost(recentPost, true);

但是帖子仍然没有发布:

4

2 回答 2

0

尝试使用不同的 wordpress 版本。我已经使用了 jwordpress-0.4.jar 并且它对我来说工作得很好,但是如果我正在运行它,不记得是哪个版本的 wordpress。

于 2011-08-19T09:06:01.587 回答
0

在您的代码中,您输入:

recentPost.setPost_status("Published");

但改用这个:

recentPost.setPost_status("Publish");
于 2015-07-22T18:27:47.780 回答