A WordPress-centric search engine for devs and theme authors



wp_is_post_revision ›

Since2.6.0
Deprecatedn/a
wp_is_post_revision ( $post )
Parameters:
  • (int|object) $post Post ID or post object.
    Required: Yes
Returns:
  • (bool|int) False if not a revision, ID of revision's parent otherwise.
Defined at:
Codex:

Determines if the specified post is a revision.



Source

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

	return (int) $post->post_parent;
}