【发布时间】:2015-02-17 06:50:55
【问题描述】:
我正在尝试 Python wordpress_xmlrpc 文档中的行,http://python-wordpress-xmlrpc.readthedocs.org/en/latest/overview.html。
这是我所拥有的:
wp = Client('https://remembertochange.wordpress.com/xmlrpc.php', 'user', 'pass')
posts = wp.call(GetPosts())
post = WordPressPost()
post.title = 'My new title'
post.content = 'This is the body of my new post.'
post.terms_names = {
'post_tag': ['test', 'firstpost'],
'category': ['Introductions', 'Tests']
}
wp.call(NewPost(post))
post.post_status = 'publish'
问题是它只是将草稿添加到博客,并没有将其作为新帖子发布到博客。
它有什么问题,我该如何纠正?谢谢。
【问题讨论】:
-
您是否尝试在调用 wp.call(NewPost(post)) 之前放置 post.post_status = 'publish'?
-
@Furkan Omay,你真是个天才!你介意把它作为答案让我选择吗?
-
我做了 :) 我想它解决了你的问题。
-
@Furkan Omay,太棒了!