• Hi to all Wp experts and Fans.

    I am making wiki-like plugin to maintain system documents.
    Then I start wondering if I can use revisions as a version control system.

    I know how to stop saving revision or limit the numbers of revisions to be kept by using a plugin or some snippets.
    But I wonder if I can save a post as a revision only when I want to while I stop revision basically. (like adding “save as revision” button)

    I appreciate any information of existing plugin or ideas of an implementation of this function.

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Thread Starter formless

    (@formless)

    Thank you for an information @sterndata

    The plugin looks interesting to me too.
    The revisionized post made by the plugin is in “draft” post_status,
    so seemingly I will be able to use it together with my plugin which I am planing.

    So far, I’ve found a function “wp_save_post_revision” hooked in “pre_post_update”.
    Maybe, this will work?

    1. Add “save as revision” button in post.php screen.
    – on_click on it, submit with a hidden param “save_as_revision=1”
    2. in “pre_post_update” hook with priority as 9, check the param above
    – if the param doesn’t exists, then remove_action “wp_save_post_revision” from hook “pre_post_update”.

    Anyway, I’ll try it!

    Thread Starter formless

    (@formless)

    Sorry for my murmuring…

    I jsut thought that I should use the hook “wp_save_post_revision_post_has_changed” simply…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘save a post as a revision only when I want to?’ is closed to new replies.