wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_is_post_revision › WordPress Function

Depuis2.6.0
Dépréciéen/a
wp_is_post_revision ( $post )
Paramètres:
  • (int|WP_Post) $post Post ID or post object.
    Requis: Oui
Retourne:
  • (int|false) ID of revision's parent on success, false if not a revision.
Défini(e) dans:
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;
}