Using Gravity Forms ‘gform_pre_entry_list’ PHP action

The gform_pre_entry_list Gravity Forms action fires before the entry list content is generated, allowing you to add content above the page title.

Usage

A generic example to use this action for all forms:

add_action('gform_pre_entry_list', 'your_function_name');

Parameters

  • $form_id (integer): The ID of the form for which the entry list is being displayed.

More information

See Gravity Forms Docs: gform_pre_entry_list

This action was added in Gravity Forms 1.9.13.21.

Examples

Display a message above the entry list

This example displays a custom message above the entry list.

add_action('gform_pre_entry_list', 'display_message');
function display_message($form_id) {
    echo 'Welcome to the entry list!';
}

Show a form-specific message

This example displays a custom message based on the form ID.

add_action('gform_pre_entry_list', 'display_form_specific_message');
function display_form_specific_message($form_id) {
    if ($form_id == 1) {
        echo 'Welcome to the entry list of Form 1!';
    } elseif ($form_id == 2) {
        echo 'Welcome to the entry list of Form 2!';
    }
}

Display the form title above the entry list

This example displays the form title above the entry list.

add_action('gform_pre_entry_list', 'display_form_title');
function display_form_title($form_id) {
    $form = GFAPI::get_form($form_id);
    echo '<h2>' . $form['title'] . '</h2>';
}

Show an admin notice above the entry list

This example displays an admin notice above the entry list.

add_action('gform_pre_entry_list', 'display_admin_notice');
function display_admin_notice($form_id) {
    echo '<div class="notice notice-info"><p>This is an important notice for admins.</p></div>';
}

Add custom CSS class to the entry list table

This example adds a custom CSS class to the entry list table.

add_action('gform_pre_entry_list', 'add_custom_css_class');
function add_custom_css_class($form_id) {
    echo '<style>.gforms_entry_list { background-color: lightblue; }</style>';
}