(I assume you enable ‘Delete all revisions on initial publication’ option. This is enabled by default.)
TOR deletes draft revisions just when you publish it for the first time. In other words, you can use draft revisions while you keep it as a draft.
Correction though you might not mind it.
‘Delete all revisions on initial publication’ option is OFF by default. You should turn it on if you like this behavior.
No, I left “delete all revisions on initial publication off.
My test on a backup db showed that it DID delete.
SELECT *
FROM wp_posts
WHERE post_status
= ‘draft’
AND post_type
= ‘revision’
showed several posts matching. Then ran your plugin, ran that query again, and got no matches.
Is there a way to keep all revisions for drafts, no matter how old?
Your SQL is wrong. Post_status of revisions is ‘inherit’. Try SQL below.
select p1.ID
from wp_posts p1, wp_posts p2
where p1.post_status = 'inherit'
and p1.post_type = 'revision'
and p1.post_parent = p2.ID
and p2.post_status = 'draft';
Ah. Ok, will test out like that.
Thanks.
I think this topic can be closed because no additional negative response so far. I marked it as resolved.