6

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:

Tom
  • 33,626
  • 31
  • 85
  • 109
Khoyendra Pande
  • 1,627
  • 5
  • 25
  • 42

2 Answers2

0

In your code you put:

recentPost.setPost_status("Published");

But use this instead:

recentPost.setPost_status("Publish");
Fjodr
  • 919
  • 13
  • 32
Aldo
  • 1
0

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.

Kris
  • 5,714
  • 2
  • 27
  • 47