gform_delete_entry_link

Description

The gform_delete_entry_link filter can be used to modify the HTML for the “Delete Permanently” link that appears in the entry list table when viewing entries in the trash or spam filters.

Usage

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

Parameters

ParameterTypeDescription
$delete_linkstringThe HTML for the delete link. Default contains an anchor tag with data attributes for AJAX deletion and the text “Delete Permanently”.

Examples

add_filter( 'gform_delete_entry_link', 'customize_delete_entry_link', 10, 1 );

function customize_delete_entry_link( $delete_link ) {
    $custom_link = '<a data-wp-lists="delete:the-list:entry_row_{entry_id}::status=delete&entry={entry_id}" href="' . wp_nonce_url( '?page=gf_entries', 'gf_delete_entry' ) . '" class="row actions" onclick="return confirm(\'Are you absolutely sure you want to permanently delete this entry? This action cannot be undone.\');">' . esc_html__( 'Permanently Remove', 'gravityforms' ) . '</a>';
    
    return $custom_link;
}

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Source Code

This filter is located in entry_list.php.