On this page
wp_is_post_revision( int|WP_Post $post ): int|false
Determines if the specified post is a revision.
Parameters
$postint|WP_Post Required-
Post ID or post object.
Return
int|false ID of revision's parent on success, false if not a revision.
Source
File: wp-includes/revision.php. View all references
function wp_is_post_revision( $post ) {
$post = wp_get_post_revision( $post );
if ( ! $post ) {
return false;
}
return (int) $post->post_parent;
}
Related
Uses
| Uses | Description |
|---|---|
| wp_get_post_revision() wp-includes/revision.php | Gets a post revision. |
Used By
| Used By | Description |
|---|---|
| wp_post_revision_title() wp-includes/post-template.php | Retrieves formatted date timestamp of a revision (linked to that revisions’s page). |
| wp_post_revision_title_expanded() wp-includes/post-template.php | Retrieves formatted date timestamp of a revision (linked to that revisions’s page). |
| add_post_meta() wp-includes/post.php | Adds a meta field to the given post. |
| delete_post_meta() wp-includes/post.php | Deletes a post meta field for the given post ID. |
| update_post_meta() wp-includes/post.php | Updates a post meta field based on the given post ID. |
Changelog
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_is_post_revision