Skip to content

Instantly share code, notes, and snippets.

David Smith spivurno

Block or report user

Report or block spivurno

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:766963
<?php
add_filter("gform_pre_render", "populate_dropdown");
function populate_dropdown($form){
global $current_user;
get_currentuserinfo();
foreach($form['fields'] as &$field) {
if($field['inputName'] == 'email') {
@spivurno
spivurno / gist:3708032
Created Sep 12, 2012
Gravity Wiz // Populate Date: Year from Current Date
View gist:3708032
/**
* Populate Date: Year from Current Date
*/
add_filter('gform_field_value_year_from_date', 'gw_year_from_date');
function gw_year_from_date() {
return date('m/d/Y', strtotime('+1 year'));
}
@spivurno
spivurno / gw-gravity-forms-populate-date-year-from-today.php
Last active Sep 5, 2016
Gravity Wiz // Populate Date: Year from Current Date
View gw-gravity-forms-populate-date-year-from-today.php
<?php
/**
* Populate Date: Year from Current Date
*/
add_filter('gform_field_value_year_from_date', 'gw_year_from_date');
function gw_year_from_date() {
return date('Y-m-d', strtotime('+1 year'));
}
@spivurno
spivurno / conditionalconfirmations.php
Last active Oct 10, 2015
Gravity Wiz // Conditional Confirmations
View conditionalconfirmations.php
<?php
/**
* Conditional Confirmations (with Merge Tag Support)
* http://gravitywiz.com/2012/08/18/conditional-confirmations/
*
* Provides the ability to register conditional confirmations. To register a new conditional confirmation
* use the GWConditionalConfirmations::add_conditional_confirmation() function.
*
* GWConditionalConfirmations::add_conditional_confirmation($form_id, $field_id, $operator, $value, $confirmation);
@spivurno
spivurno / gist:3708552
Last active Oct 10, 2015
Gravity Wiz // Conditional Confirmations: Examples
View gist:3708552
<?php
// example for form ID 7 where the confirmation will redirect the user to http://google.com if the value of field ID 3 is less than 10
GWConditionalConfirmations::add_conditional_confirmation(7, 3, 'less_than', 10, array('redirect' => 'http://google.com'));
// example for form ID 5 where a text confirmation will be displayed if field ID 2 is equal to "Virginia"
GWConditionalConfirmations::add_conditional_confirmation(5, 2, 'is', 'Virginia', 'Confirmed! You are from Virginia!');
// example for form ID 11 where the confirmation will redirect to the WordPress page ID 12 if the value of field ID 4 is greater than 500
GWConditionalConfirmations::add_conditional_confirmation(11, 4, 'greater_than', 500, array('page' => 12));
@spivurno
spivurno / gw-gravity-forms-better-pre-submission-confirmation.php
Last active Apr 29, 2019
Gravity Wiz // Gravity Forms // Better Pre-submission Confirmation
View gw-gravity-forms-better-pre-submission-confirmation.php
<?php
/**
* Better Pre-submission Confirmation
* http://gravitywiz.com/2012/08/04/better-pre-submission-confirmation/
*/
class GWPreviewConfirmation {
private static $lead;
public static function init() {
@spivurno
spivurno / gist:3708669
Created Sep 12, 2012
Gravity Wiz // Require All Columns of List Field
View gist:3708669
<?php
/**
* Require All Columns of List Field
* http://gravitywiz.com/2012/07/23/require-all-columns-of-list-field/
*/
add_filter('gform_validation', 'gwiz_require_all_list_columns');
function gwiz_require_all_list_columns($validation_result) {
@spivurno
spivurno / gw-gravity-forms-random-field-order.php
Last active Apr 16, 2019
Gravity Wiz // Gravity Forms // Random Field Order
View gw-gravity-forms-random-field-order.php
<?php
/**
* Gravity Wiz // Gravity Forms // Random Fields
*
* Randomly display a specified number of fields on your form.
*
* @version 1.1
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link https://gravitywiz.com/random-fields-with-gravity-forms/
@spivurno
spivurno / gist:3708752
Created Sep 12, 2012
Gravity Wiz // Limit How Many Checkboxes Can Be Checked
View gist:3708752
<?php
/**
* Limit How Many Checkboxes Can Be Checked
* http://gravitywiz.com/2012/06/11/limiting-how-many-checkboxes-can-be-checked/
*/
class GFLimitCheckboxes {
public static $field_limits;
@spivurno
spivurno / gw-gravity-forms-list-field-rows-by-field-value.php
Last active Aug 22, 2019
Gravity Wiz // Set Number of List Field Rows by Field Value
View gw-gravity-forms-list-field-rows-by-field-value.php
<?php
/**
* Gravity Wiz // Gravity Forms // Set Number of List Field Rows by Field Value
*
* Add/remove list field rows automatically based on the value entered in the specified field. Removes the add/remove
* that normally buttons next to List field rows.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
You can’t perform that action at this time.