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.000741s = slow | 50000 times = 1.31s = fast

No Hooks.

Return

false/Int. False if not a revision, ID of revision's parent otherwise.

Usage

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

Code of wp_is_post_revision: wp-includes/revision.php VER 4.9.8

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

	return (int) $post->post_parent;
}

Related Functions

From tag: post revisions

No comments
    Hello, !     Log In . Register