Using Gravity Forms ‘gform_is_entry_detail_edit’ PHP filter

The gform_is_entry_detail_edit filter allows the “entry_detail_edit” page to be marked as a regular page, not an admin or edit page, or a regular page to be marked as an Entry Detail Edit page. This filter is useful if you are creating custom entry edit pages.

Usage

add_filter('gform_is_entry_detail_edit', 'your_function_name', 10, 1);

Parameters

  • $is_entry_detail_edit (bool): Whether the current page is the Entry Detail Edit (entry_detail_edit) page.

More information

See Gravity Forms Docs: gform_is_entry_detail_edit

Examples

Mark entry_detail_edit page as a regular page

This example sets the entry_detail_edit page to be considered as a regular page rather than an admin or edit page.

add_filter('gform_is_entry_detail_edit', 'set_entry_edit', 10, 1);

function set_entry_edit($is_entry_detail_edit) {
    return false;
}

Mark a regular page as an entry_detail_edit page

This example sets a regular page to be considered as an entry_detail_edit page.

add_filter('gform_is_entry_detail_edit', 'set_regular_page_as_entry_edit', 10, 1);

function set_regular_page_as_entry_edit($is_entry_detail_edit) {
    return true;
}

Conditionally mark a page as entry_detail_edit

This example conditionally marks a specific page as an entry_detail_edit page based on the page’s ID.

add_filter('gform_is_entry_detail_edit', 'conditionally_set_entry_edit', 10, 1);

function conditionally_set_entry_edit($is_entry_detail_edit) {
    if (get_the_ID() == 123) {
        return true;
    }
    return $is_entry_detail_edit;
}

Mark all pages with a specific template as entry_detail_edit

This example marks all pages that use a specific template as entry_detail_edit pages.

add_filter('gform_is_entry_detail_edit', 'mark_template_pages_as_entry_edit', 10, 1);

function mark_template_pages_as_entry_edit($is_entry_detail_edit) {
    if (is_page_template('page-custom-entry-edit.php')) {
        return true;
    }
    return $is_entry_detail_edit;
}

Mark all pages within a specific category as entry_detail_edit

This example marks all pages within a specific category as entry_detail_edit pages.

add_filter('gform_is_entry_detail_edit', 'mark_category_pages_as_entry_edit', 10, 1);

function mark_category_pages_as_entry_edit($is_entry_detail_edit) {
    if (in_category('entry-edit')) {
        return true;
    }
    return $is_entry_detail_edit;
}