Support » Plugin: Live Drafts » Live Drafts changes post slug on publish

  • I was encountering a problem where I would save a draft of a post, make my changes, then re-publish, only to discover my post URL had changed.

    I eventually tracked this down to line 148 of liveDrafts.php: it uses wp_insert_post to update the existing post, but since it doesn’t declare post_name WordPress uses the default value for the slug.

    To cut a long story short, I fixed it by replacing wp_insert_post with wp_update_post on line 148 of liveDrafts.php, since wp_update_post only updates the fields supplied (rather than using the default for unsupplied fields).

    I’m posting this in case anybody else has the problem, and also to offer it as a bugfix for future releases.

    http://wordpress.org/extend/plugins/live-drafts/

  • The topic ‘Live Drafts changes post slug on publish’ is closed to new replies.