Skip to content

How to add a category while posting to wordpres? #52

@pumpadump

Description

@pumpadump

Hi, i tried to post this question to stackoverflow but the recommended tag "wordpress-java" does not exist.

I want to use the wordpressj api client to post to wordpress via xmlrpc.
I'm using it like this:

    Wordpress wp =  new Wordpress(username, password, xmlRpcUrl);
    Post post = new Post();
    post.setPost_title("test");
    DateTime date = new DateTime(1990, 12, 1, 1, 1);
    post.setPost_date(date.toDate());
    post.setPost_status("pending");
    post.setPost_excerpt("test test");
    wp.newPost(post);

How can I add a category to this post?

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions