WordPress at a glance

wp_is_post_revision() WP 1.0

Determines if the specified post is a revision.

Works based on: wp_get_post_revision()
1 time — 0.000741 sec (slow) | 50000 times — 1.31 sec (fast)

No Hooks.


Int|false. ID of revision's parent on success, false if not a revision.


wp_is_post_revision( $post );
$post(int|WP_Post) (required)
Post ID or post object.


Since 2.6.0 Introduced.

Code of wp_is_post_revision() WP 5.7.2

function wp_is_post_revision( $post ) {
	$post = wp_get_post_revision( $post );
	if ( ! $post ) {
		return false;

	return (int) $post->post_parent;

From tag: post revisions

More from tag: Conditional tags (all)

No comments
    Log In