maxcutler / python-wordpress-xmlrpc

Python library for WordPress XML-RPC integration
http://python-wordpress-xmlrpc.rtfd.org
MIT License
383 stars 130 forks source link

Can't set categories or tags as in the example #121

Closed benlong100 closed 6 years ago

benlong100 commented 6 years ago

I've been playing with the demo code and while it's creating a post with no problem, it's not setting the category or tags. Here's what I've got to create a post:

wp=Client('http://500kelvin.doesntexist.com/xmlrpc.php','ben','cactus42') post=WordPressPost() post.title = 'Come As You Are' post.content = "Blah blah blah" post.terms_names = {'category':'music','post_tag':'testing testing'} post.post_status = 'publish' theNewPostID = wp.call(NewPost(post))

I do have a Music category defined, and I've tried using both 'Music' and 'music' in the call, but posts always come in uncategorized. What am I missing?

Thanks

n3storm commented 6 years ago

From the docs: Note that terms_names is a dictionary with taxonomy names as keys and list of strings as values.