Skip Navigation

[Resolved] Post Edit revision data

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 8 months, 1 week ago.

Assisted by: Waqar.

Author
Posts
#2693127

I am trying add post revisions when I edit a post with the post edit form generated from Toolset.

I already enabled post revisions by adding `define( 'WP_POST_REVISIONS', TRUE );` in `wp-config.php`.

I created a function that uses `wp_save_post_revision` a core from WP and hooked into `cred_submit_complete` and `cred_save_data` but the form still doesn't record the post revisions.

Can you help me adding post revision data when the post edit form submitted?

#2693230

Hi,

Thank you for contacting us and I'd be happy to assist.

I've performed some tests on my website with different hooks from Toolset Forms API, but couldn't make the 'wp_save_post_revision' function work with them, either.

A feature like this will require some structural changes to how the edit forms handle post data.

Can you please share some background details, on how you're planning to use these post revisions? I'll be in a better position to suggest some alternatives, accordingly.

regards,
Waqar

#2695084

Waqar,

Some background: We are using the post revision for history / versioning control of the content. We want to generally avoid going to the admin area to add / edit posts. Only admins should be able to do that. We noticed that submitting the front end form doesn't generate revisions.

I already found a solution by installing a plugin that handles revisions. I hope that toolset post modification forms should be able to do this even if not by default and be turned on/off with an API hook.