gform_form_actions

Description

Use this filter to add custom form actions which display below the form title in the Form List view.

Usage

add_filter( 'gform_form_actions', 'form_actions', 10, 2 );

Parameters

  • $actions array

    An associative array containing all of the default form actions (ie Edit, Preview, Notifications, etc.).

        array(
            'edit' => '<a href="" ... >Edit</a>',
            'preview' => '<a href="" ... >Preview</a>',
            'entries' => '<a href="" ... >Entries</a>',
            'notifications' => '<a href="" ... >Notifications</a>',
            'duplicate' => '<a href="" ... >Duplicate</a>',
            'delete' => '<a href="" ... >Delete</a>'
        );
        

  • $form_id integer

    The ID of the field from which the entry value was submitted.

Examples

This example demonstrates how to add an custom form action.

add_action( 'gform_form_actions', 'add_mergedoc_link', 10, 4 );
function add_mergedoc_link( $actions, $form_id ) {
        $actions['mergedoc_settings'] = "<a href="" . get_admin_url() . "admin.php?page=gf_mergedoc&id={$form_id}">" . __( 'MergeDoc', 'gravityformsmergedoc' ) . "</a>";
        return $actions;
}

This example demonstrates how to remove the default Duplicate action link.

add_action( 'gform_form_actions', 'remove_duplicate_link', 10, 4 );
function remove_duplicate_link( $actions, $form_id ) {
		// Remove Duplicate action link
		unset ( $actions['duplicate'] );        
        return $actions;
}

Source Code

This filter is located in GFFormList::form_list_page() in form_list.php