Gform entry created

(Created page with "__NOTOC__ == Description == This hook fires after the lead has been created but before the post has been created, notifications have been sent and the confirmation has been proce...")
Line 1: Line 1:
__NOTOC__
__NOTOC__
 +
<div class="alert_yellow pad_10">Available in GF v1.6.2</div>
 +
== Description ==
== Description ==
This hook fires after the lead has been created but before the post has been created, notifications have been sent and the confirmation has been processed.  
This hook fires after the lead has been created but before the post has been created, notifications have been sent and the confirmation has been processed.  

Revision as of 23:59, 29 November 2011

Available in GF v1.6.2

Description

This hook fires after the lead has been created but before the post has been created, notifications have been sent and the confirmation has been processed.

Usage

<?php
add_filter("gform_entry_created", "generate_mergedoc", 10, 2);
?>

Parameters

$entry
(Entry Object) The entry that was just created.
$form
(Form Object) The current form.

Examples

This example demonstrates how to use to gform_entry_created hook to populate a value in the entry's entry meta. It is possible to populate the entry meta anywhere you have the entry ID; however, let's assume that we're going to retrieve this entry meta and replace a [[gform_custom_merge_tags|custom merge tag].

<?php
add_action('gform_entry_created', 'generate_mergedoc');
function generate_mergedoc($entry, $form) {
        
    $feed = self::get_mergedoc_feeds($form['id']);
    
    if(empty($feed) || !rgar($feed, 'active') || !$entry)
        return;
    
    // get download link
    $download_link = self::get_download_link($uid);
    
    // update entry meta
    gform_update_meta($entry['id'], 'gfmergedoc_download_link', $download_link);
    
}
?>

Source Code

This filter is located in form_display.php

Search the Documentation