Skip to content

Instantly share code, notes, and snippets.

<?php
# Basic Usage
new GW_List_Field_As_Choices( array(
'form_id' => 1,
'list_field_id' => 2,
'choice_field_ids' => 3
) );
# Enable Sorting of Choices Alphanumerically
@phillipwilhelm
phillipwilhelm / gw-field-info-tab.php
Created September 5, 2016 05:17 — forked from spivurno/gw-field-info-tab.php
Gravity Wiz // Gravity Forms Field Info Tab
<?php
/**
* Gravity Forms Field Info Tab
* http://gravitywiz.com
*
* Adds a summary of your fields as a tab on the form settings screen; includes field ID, label and field type.
*
*/
class GWFieldInfo {
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-auto-populate.php
Created September 5, 2016 04:40 — forked from spivurno/gw-gravity-forms-auto-populate.php
Gravity Wiz // Gravity Forms // Auto Populate
<?php
/**
* Gravity Wiz // Gravity Forms // Auto Populate
*
* Automatically populate a form with data based on an entry ID or an array of custom data.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
@phillipwilhelm
phillipwilhelm / gp-unique-id-shared-sequences.php
Created September 5, 2016 04:28 — forked from spivurno/gp-unique-id-shared-sequences.php
Gravity Wiz // GP Unique ID // Shared Sequences
<?php
/**
* Gravity Wiz // GP Unique ID // Shared Sequences
* http://gravitywiz.com/
*
* Share sequences between sequential Unique ID fields; works with fields on
* different forms as well.
*/
add_filter( 'gpui_unique_id_attributes', 'gwiz_unique_id_global_sequential_index', 10, 3 );
function gwiz_unique_id_global_sequential_index( $atts, $form_id, $field_id ) {
@phillipwilhelm
phillipwilhelm / gp-unique-id-global-unique-id.php
Created September 5, 2016 04:24 — forked from spivurno/gp-unique-id-global-unique-id.php
Gravity Wiz // GP Unique ID // Share a global unique ID across all forms
<?php
/**
* Gravity Wiz // GP Unique ID // Share a global unique ID across all forms
*/
add_filter( 'gpui_unique_id_attributes', 'gwiz_global_unique_id', 10, 3 );
function gwiz_global_unique_id( $atts, $form_id, $field_id ) {
if( $atts['type'] != 'sequential' ) {
$atts['form_id'] = 1;
$atts['field_id'] = 1;
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-populate-entries.php
Created September 5, 2016 03:31 — forked from spivurno/gw-gravity-forms-populate-entries.php
Gravity Wiz // Gravity Forms Populate With Entries
<?php
/**
* Gravity Wiz // Gravity Forms Populate With Entries
*
* Populate choice-based fields (i.e. drop downs, radios, checkboxes) with data from Gravity Form entries.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
@phillipwilhelm
phillipwilhelm / gw-dynamic-populate-with-merge-tags.php.php
Created September 5, 2016 05:53 — forked from spivurno/gw-dynamic-populate-with-merge-tags.php.php
Gravity Wiz // Merge Tags as Dynamic Population Parameters
<?php
/**
* Merge Tags as Dynamic Population Parameters
* http://gravitywiz.com/dynamic-products-via-post-meta/
*/
add_filter('gform_pre_render', 'gw_prepopluate_merge_tags');
function gw_prepopluate_merge_tags($form) {
$filter_names = array();
@phillipwilhelm
phillipwilhelm / gist:362a2a6eefedf006ebaf8d6651b70d72
Created September 5, 2016 05:30 — forked from spivurno/gist:6584835
Gravity Forms Cookies // Saves the query string parameters from a users visit to a cookie and allows these values to be populated via Gravity Forms' Dynamic
<?php
/**
Plugin Name: Gravity Forms Cookies
Plugin URI: http://ounceoftalent.com/
Description: Saves the query string parameters from a users visit to a cookie and allows these values to be populated via Gravity Forms' Dynamic Population feature.
Version: 1.5
Author: David Smith
Author URI: http://ounceoftalent.com
License: GPL2
*/
<?php
// CREDIT: http://pastebin.com/4J7z8y2X
// allow HTML in a specific form field
// update the '344' to the ID of your form
add_filter( 'gform_allowable_tags_344', 'hearts_welcome_here', 10, 2 );
function hearts_welcome_here( $allow_html, $field ) {
// update the '2' to the ID of your field
if( $field['id'] == 2 )
return true;
/// GWS TABLE FILTER
// CREDIT: http://pastebin.com/u6yN846V
// usage: [gwstable form=17 field=1 value='Workshop A' return=2] using numeric IDs
add_shortcode('gwstable', 'gws_tablefilter');
function gws_tablefilter($atts) {
extract(shortcode_atts(array(
// set defaults
'form' => '403',
'field' => '1',