How to get the ID of the entry on Edit Entry page?
Use the following function to get the currently-edited entry: gravityview()->request->is_edit_entry()
.
It will return false if not on the Edit Entry screen, or it will return a \GV\Entry
object. Once you have the \GV\Entry
object, you can use $entry->ID
to get the entry ID.
Here's a sample code:
// Inside a hook during or after `init`
$entry = gravityview()->request->is_edit_entry()
if( $entry ) {
$entry_id = $entry->ID;
}