python-wordpress-xmlrpc icon indicating copy to clipboard operation
python-wordpress-xmlrpc copied to clipboard

How can I set post permalink?

Open lumenwrites opened this issue 9 years ago • 1 comments

Hi! I am trying to set a post permalink on the posts I'm publishing, and setting the value of "post.link" is not working. Can you help me out?

lumenwrites avatar Jul 24 '15 18:07 lumenwrites

post.link is a read-only field, it comes back from GetPost or GetPosts but NewPost and EditPost will ignore it. Instead you should be able to use post.slug which corresponds to the post_name field in WordPress' database. You can find more details about how the permalink is generated based on your WP settings and post_name here: https://codex.wordpress.org/Using_Permalinks

maxcutler avatar Jul 25 '15 17:07 maxcutler