---
title: "How to get the ID of the entry on Edit Entry page?"
date: 2026-04-23
author: "GravityKit"
link: "https://www.gravitykit.com/docs/gravityview/advanced/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;
}
```

```
// Inside a hook during or after `init`

$entry = gravityview()->request->is_edit_entry()

if( $entry ) {
  $entry_id = $entry->ID;
}
```

 [See the method in-context.](https://github.com/gravityview/GravityView/blob/master/future/includes/class-gv-request.php#L160-L185)