It turns out there is no autosaving enabled. We have lost several hours of work because the custom post types does not have autosaving. Is there a way we can enable this, like WordPress should have as standard? Been trying both Chrome and Firefox, so I guess it`s not a problem with the browser.
The autosave settings in WordPress apply to all post types, including custom post types.
You set the options in your wp-config.php file like so:
// Define WP Post Revisions
define('AUTOSAVE_INTERVAL', 30); // seconds between auto-saves
define('WP_POST_REVISIONS', 5); // how many revisions to maintain
I just tested this and it was working as expected.
You can see the draft updates being submitted if you leave the network tab of your browser dev tools open, and can see the post revisions in the wp_posts table.
Note that WordPress does not record copies of custom fields when saving auto-drafts.
WordPress does not have a "standard" autosave feature, it just creates revisions of Posts and Pages out of the box, something that is not happening for example when you edit Post Types, or Views, or similar.
By default, this is as well turned off when you create single Posts in Post types of Toolset.
But, you can enable revisions.
This is done in Toolset > Post Types > your_type > Edit > Sections to display > Revisions
This should help to create revisions of your writings, which should be what you are used to from native Posts and Pages.
Okay, thank you. Revisions has always been enabled, but revisions only comes up when the title has been changed. I guess this is because Editor is not enabled, instead we are using a Editor created from CPT with a custom name. Are there no ways we can enable revisions to affect fields created with Toolset?
It isn't supported by WordPress and hence isn't a feature of Toolset (though I think this is a reasonable feature request and I'm going to propose it).
It is possible to get this to work, but you would be setting up such a system yourself.
There is a good description of what's required here: hidden link
If you know a little PHP it should be possible to implement something like this for your site.
If you don't then you would need to contact a developer to do it for you (we maintain a list of Toolset contractors that you can find in the sidebar, though this is not a Toolset issue as such).
Also, there is a plugin which aims to provide this functionality, though I don't believe it ever got accepted into core: hidden link
At this point the revisions works, but I am not able to see the revisions in the "preview" page. All I see is the title and not the field. Please see attachment. But when I go back to a version the old version shows up. So it kinda works.
However, I am missing the autosaving feature. Is there no way to active it, since I have activated the revisions now?
Auto-saves and revisions work in a similar way in terms of how they are stored in the database and auto-saves should continue to work whether or not post revisions are active, as described here: https://codex.wordpress.org/Revisions
I would double-check in wp_posts whether your auto-saves really are missing or not.
If they are missing, comment out your custom code and see if they return.
Because this is not something Toolset supports there is not much help I can offer in terms of the code you have written I'm afraid.