How do you set post format to 'standard' with python wordpress_xmlrpc?
I have been unable to use wordpress_xmlrpc's EditPost to change an 'aside' or other non-standard format post back to standard. The basic code I am using is:
from wordpress_xmlrpc import Client, WordPressPost
import wordpress_xmlrpc.methods.posts as wpp
client = Client(...)
post = client.call(wpp.GetPost(n))
post.post_format = 'standard'
post.title = 'visited -- ' + post.title
post.content = 'visited -- ' + post.content
r = client.call(wpp.EditPost(post.id, post))
When I run this code I always see that the post in question was indeed "visited" by changes to title and content. But if the post had format 'aside', then running the code above does not change the format to 'standard'. (Trying None, 0, [] in place of 'standard' on the line above did not work either.)
However, if the post is format 'standard' and I run the code above with the one line changed to
post.post_format = 'aside'
then the post in question does change to format 'aside'.
How do I use EditPost to change a post's format to standard? Thanks!
コメント