Search code examples
javawordpressposting

Publishing posts in WordPress using jwordpress


I am using jwordpress-0.4.jar to post to a WordPress installation.

The code I am using is:

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);

This worked well before, but now when I go to publish it goes to its scheduling mode, I have tried:

recentPost.setPost_status("Published");

and

wp.newPost(recentPost, true);

But the post is still no published:


Solution

  • Try it with different wordpress version. I have used the jwordpress-0.4.jar and it was working for me fine, don't remember which version if wordpress I was running it on though.