(Advanced) How to tell if an entry is a revision in PHP

GravityRevisions have a custom entry status that you can check against in your code.

The easiest way to check whether an entry is a revision is to compare it against that status:

$entry = GFAPI::get_entry( 1234 ); // Replace '1234' with your own Entry ID

if( 'gv-revision' === $entry['status'] ) {
	// This entry is actually a revision!
}

Read here how to add these code samples to your website: Where to put code samples.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us