wp_is_post_revision( int|WP_Post $post )

Determines if the specified post is a revision.


Parameters Parameters

$post

(int|WP_Post) (Required) Post ID or post object.


Top ↑

Return Return

(int|false) ID of revision's parent on success, false if not a revision.


Top ↑

Source Source

File: wp-includes/revision.php

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

	return (int) $post->post_parent;
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.