Closed mplorentz closed 6 years ago
I can't reproduce this issue. Could it be how you are writing the date? It should be in datetime
format. The code below works for me.
from wordpress_xmlrpc import Client, WordPressPost
from datetime import datetime
client = Client(url, username, password)
post = WordPressPost()
post.title = 'Title Foo'
post.content = 'Content Bar'
post.post_status = 'publish'
post.id = client.call(posts.NewPost(post))
post.date = datetime(2016,1,1)
post.date_modified = datetime(2016,1,1)
client.call(posts.EditPost(post.id, post))
From there, visiting the post shows that the date is 2016-01-01.
Actually I just ran my code again and it works just fine... must've been a problem with my install which has been resolved. Thanks for taking a look!
thx
Hi, I'm trying to create a new post with a publish date in the past. The post is created just fine, but the publish date shows as the time the post was created and not the date I set. I can edit the post date to be in the past in the Wordpress GUI so I think this should be possible.
I have tried setting the date before creating the post and after. Here is my code for the latter:
Is there some reason that setting the publish date to be in the past is not possible via the xmlrpc API, or am I doing something wrong?