wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_is_post_revision › WordPress Function

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

Determines if the specified post is a revision.



Source

function wp_is_post_revision( $post ) {
	$post = wp_get_post_revision( $post );

	if ( ! $post ) {
		return false;
	}

	return (int) $post->post_parent;
}