Spivurno (Talk | contribs)
(Created page with "__NOTOC__ == Description == Use this filter to add custom form actions which display below the form title in the Form List view. == Usage == <pre class="brush:php"> <?php add_...")
Newer edit →
(Created page with "__NOTOC__ == Description == Use this filter to add custom form actions which display below the form title in the Form List view. == Usage == <pre class="brush:php"> <?php add_...")
Newer edit →
Revision as of 21:57, 21 November 2011
Description
Use this filter to add custom form actions which display below the form title in the Form List view.
Usage
<?php
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.
<?php
add_action('gform_entries_first_column_actions', 'first_column_actions', 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;
}
?>
Source Code
This filter is located in form_list.php