Table of Contents
Currently, PublishPress Revisions does not have a plugin API to create a pending revision or scheduled revision. However, you create revisions with some $wpdb->insert() calls. Follow these steps to create revisions.
Step #1. Add to the wp_posts table #
wp_posts row with these details:
post_type, use the same as the published post
comment_countthis should be equal to the published post ID
ping_statusyou modify these as needed.
Step #2. Add to the wp_postmeta table #
wp_postmeta row with these details:
post_idshould be equal to the newly inserted pending revision ID
meta_valueshould be equal to the published post ID
Also insert or update a wp_postmeta row with these details:
post_idshould be equal to thee published post ID
Note about other wp_post fields #
post_authoris understood to be the author of the revision, not a requested change to the published post author.
post_date_gmtrepresents the requested publication date. This may be a past date to update the published post to on revision approval. Or it will the future date to schedule publication for on revision approval.