Skip to content

Instantly share code, notes, and snippets.

@spivurno
spivurno / ch-gravity-forms-date-rounder.php
Created March 3, 2015 12:58
Ounce // Gravity Forms // Date Rounder
<?php
/**
* Ounce // Gravity Forms // Date Rounder
*
* Allows the ability to round the date up (or down) to a day of the month.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
@spivurno
spivurno / gp-nested-forms-populate-nested-form-field.php
Created April 26, 2016 15:32
Gravity Perks // GP Nested Forms // Populate Nested Form Field
<?php
/**
* Gravity Perks // GP Nested Forms // Populate Nested Form Field
*/
add_action( 'gform_enqueue_scripts', function( $form ) {
if( $form['id'] == 508 ) {
foreach( $form['fields'] as $field ) {
if ( $field->id == 2 ) {
$_POST["input_{$field->id}"] = '7631,7629';
}
@spivurno
spivurno / gw-gravity-forms-create-coupons.php
Last active October 7, 2021 15:07
Gravity Wiz // Gravity Forms // Create Coupons with Gravity Forms for Gravity Forms, WooCommerce, or Easy Digital Downloads
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-create-coupon.php
*/
/**
* Gravity Wiz // Gravity Forms // Create Coupons with Gravity Forms for Gravity Forms, WooCommerce, or Easy Digital Downloads
*
* Create coupons via Gravity Forms submissions. Map the coupon code to a field on the GF form and voila!
@spivurno
spivurno / gw-gravity-forms-advanced-conditional-logic.php
Last active March 5, 2024 11:32
Gravity Wiz // Gravity Forms // Advanced Conditional Logic
<?php
/**
* Gravity Wiz // Gravity Forms // Advanced Conditional Logic
*
* PLEASE NOTE: This snippet is a proof-of-concept. It is not supported and we have no plans to improve it.
*
* Allows multiple groups of conditional logic per field.
*
* @version 0.1
* @author David Smith <david@gravitywiz.com>