Core Function
View Source on Trac ↗ _wp_put_post_revision()
_wp_put_post_revision( mixed $post = null, mixed $autosave = false ) Inserts post data into the posts table as a post revision.
Parameters 2 required
| Name / Type | Description |
|---|---|
| (int | | WP_Post | array | null) $post Post ID, post object OR post array. Required |
| bool | $autosave Optional. Whether the revision is an autosave or not. Default false. Required |
Return Value
((int)
| WP_Error) WP_Error or 0 if error, new revision ID if success.
Function Information
Since Version
2.6.0
Source File
wp-includes/revision.php
Advertisement