wordpress / latest / functions / wp_is_post_revision.html

wp_is_post_revision( int|WP_Post $post ): int|false

Determines if the specified post is a revision.

Parameters

$post int|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;
}

Used By

Used By Description

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