Live Drafts
Live Drafts changes post slug on publish (1 post)

  1. Elizabeth Powell
    Posted 5 years ago #

    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.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Live Drafts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

  • RSS feed for this topic
  • Started 5 years ago by Elizabeth Powell
  • This topic is not a support question
  • WordPress version: 3.1