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 #
Insert a wp_posts row with these details:
- For
post_type, use the same as the published post - For
post_statususepending - For
comment_countthis should be equal to the published post ID - For
post_mime_typeusepending-revision - For
post content,post_title,post_parent,comment_statusandping_statusyou modify these as needed.
Step #2. Add to the wp_postmeta table #
Insert a wp_postmeta row with these details:
- The
post_idshould be equal to the newly inserted pending revision ID - For
meta_keyuse_rvy_base_post_id - The
meta_valueshould be equal to the published post ID
Also insert or update a wp_postmeta row with these details:
- The
post_idshould be equal to thee published post ID - For
meta_keyuse_rvy_has_revisions - For
meta_valueuse1
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/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.
