This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This adds display names for all users to a drop down box on a gravity form. | |
add_filter("gform_pre_render", "populate_zone"); | |
//Note: when changing drop down values, we also need to use the gform_admin_pre_render so that the right values are displayed when editing the entry. | |
add_filter("gform_admin_pre_render", "populate_zone"); | |
function populate_zone($form){ | |
//only populating drop down for form id 9 - if editing this change to your own form ID | |
if($form["id"] != 7) | |
return $form; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creating a chain select for a Gravity Forms List Field - https://docs.gravityforms.com/gf_field_list/ | |
// TO-DO - Populate Column 3 "Company" with user display_names that have the role of 'company' | |
// Note: when changing drop down values, we also need to use the gform_admin_pre_render so that the right values are displayed when editing the entry. | |
add_filter( 'gform_entries_column_filter', 'populate_complist', 10, 5 ); | |
add_filter( 'gform_column_input', 'populate_complist', 10, 5 ); | |
function populate_complist($value, $form_id, $field_id, $entry, $column, $query_string){ | |
//only populating drop down for form id 7 - if editing this change to your own form ID | |
if($form["id"] != 42 && $field_id != 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The following snippet will populate a List Field's dropdown with another forms entries. | |
// Direct the snippet to populate the field with "gform_column_input_42_1_3". 42 being the | |
// field, 1 being the field, and 3 being the column | |
// BE AWARE - changing the column in the list field will break this snippet | |
add_filter( 'gform_column_input_42_1_3', 'business_column', 10, 5 ); | |
function business_column( $input_info, $field, $column, $value, $form_id ) { | |
$items = array(); | |
// Input the type of meta you want to look got and the defining result. For me this was users with the role of "company". | |
$metas = get_users( array( 'role' => 'company' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The following snippet will populate a List Field's dropdown with another forms entries. | |
// Direct the snippet to populate the field with "gform_column_input_42_1_4". 42 being the | |
// field, 1 being the field, and 4 being the column | |
// BE AWARE - changing the column in the list field will break this snippet | |
add_filter( 'gform_column_input_42_1_4', 'feature_column', 10, 5 ); | |
function feature_column( $input_info, $field, $column, $value, $form_id ) { | |
// Input the form ID that you wish to pull from. For me that was field 7 | |
$form_id = 7; | |
$entries = GFAPI::get_entries( $form_id ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// created by [email protected] | |
// for Gravity Forms | |
// add to functions or to snippet plugin | |
// NEEDS - On line 15, add max allowed for what you want the redirect to do | |
// CUSTOMIZING - For certain forms, change '{form_id}' or add a conditional statement | |
add_filter( 'gform_pre_render_{form_id}', 'gf_form_count_{form_id}' ); | |
function gf_form_count_{form_id}($form){ | |
// Change per form | |
$user_id = get_current_user_id(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$entry = array( | |
'form_id' => $form_id, | |
'date_created' => $today, | |
'is_starred' => 0, | |
'is_read' => 1, | |
'created_by' => $user_id, | |
'status' => 'active', | |
'payment_status' => 'Commission', | |
'6' => 'Admin', | |
'13' => $company_name, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function gaws_edit_entry( $entry, $form ) { | |
$form_id = $form['id']; | |
if( $form_id == 2 ){ | |
$data = array(); | |
$csv0 = array( | |
array( | |
'Client ID', |