• Resolved bartekp

    (@bartekp)


    Hey,
    Thanks for this fantastic stuff. It works great with the latest version of WordPress.
    I have a question. Is there any chance to automatically delete drafted page and overwrite the original by this one. For example: situation when author has end making changes and admin would like to publish it. When admin click on “publish” it will be overwritten with original but in admin panel I have now two similar pages. I would like to delete revision and have only one version – original.

    Can I do it with simple code? Delete draft after publishing it by admin. I would not like to have a mess in admin panel.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author jamiechong

    (@jamiechong)

    @bartekp if I added a hook that allowed you to run your own code after publish (I’d pass the two posts: the newly published post, and the one that becomes draft). Then you can decide to delete the draft if you’d like.

    Plugin Author jamiechong

    (@jamiechong)

    @bartekp v1.3.2 now has a filter that prevents a revision of the original post from being created when the revision is published. Add this to your code:

    add_filter('revisionize_keep_original_on_publish', '__return_false');

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Delete draft after overwritting it’ is closed to new replies.