wp_is_post_revision() – Determines if the specified post is a revision.

You appear to be a bot. Output may be restricted

Description

Determines if the specified post is a revision.

Usage

$int|false = wp_is_post_revision( $post );

Parameters

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

Returns

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

Source

File name: wordpress/wp-includes/revision.php
Lines:

1 to 9 of 9
function wp_is_post_revision( $post ) {
  $post = wp_get_post_revision( $post );

  if ( ! $post ) {
    return false;
  }

  return (int) $post->post_parent;
}
 

 View on GitHub View on Trac