Skip to content

Instantly share code, notes, and snippets.

@phillipwilhelm
phillipwilhelm / gp-nested-forms-gpnf_init_scripts_args.php
Created September 5, 2016 04:42
Gravity Wiz // Gravity Perks // GP Nested Forms // Customize the Modal Size
<?php
add_filter( 'gpnf_init_script_args_508_2', 'my_nested_forms_args' );
function my_nested_forms_args( $args ) {
$args['modalWidth'] = 900;
$args['modalHeight'] = 900;
return $args;
}
@phillipwilhelm
phillipwilhelm / gp-nested-forms-gpnf_item_labels.php
Created September 5, 2016 04:42 — forked from spivurno/gp-nested-forms-gpnf_item_labels.php
Gravity Wiz // Gravity Perks // GP Nested Forms // Customize the Item Labels (i.e. "Add Entry", "View Entry")
<?php
// basic usage
add_filter( 'gpnf_item_labels', 'my_item_labels' );
function my_item_labels() {
return array(
'singular' => __( 'employee', 'gravityperks' ),
'plural' => __( 'employees', 'gravityperks' )
);
}
@phillipwilhelm
phillipwilhelm / gp-nested-forms-sum-nested-form-fields.php
Created September 5, 2016 04:43 — forked from spivurno/gp-nested-forms-sum-nested-form-fields.php
Gravity Perks // GP Nested Forms // Get Sum of Nested Form Field Column
<?php
/**
* Gravity Wiz // Gravity Perks // Get Sum of Nested Form Fields
*
* Get the sum of a column from a Gravity Forms List field.
*
* @version 1.3
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
@phillipwilhelm
phillipwilhelm / gp-limit-choices-spots-left-plus-waiting-list.php
Created September 5, 2016 04:50 — forked from spivurno/gp-limit-choices-spots-left-plus-waiting-list.php
Gravity Perks // GP Limit Choices // Spots Left + Waiting List Message
/**
* Gravity Perks // GP Limit Choices // Spots Left + Waiting List Message
*
* Allows you to display the number of spots left in the label of each choice. If there are no spots left, will display a waiting list message.
*
* @link http://gravitywiz.com/documentation/gp-limit-choices/
*/
add_filter( 'gplc_remove_choices', '__return_false' );
add_filter( 'gplc_disable_choices', '__return_false' );
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-rounding.php
Created September 5, 2016 04:51 — forked from spivurno/gw-gravity-forms-rounding.php
Gravity Wiz // Gravity Forms // Rounding by Increment
<?php
/**
* Gravity Wiz // Gravity Forms // Rounding by Increment
*
* Provides a variety of rounding functions for Gravity Form Number fields powered by the CSS class setting for each field. Functions include:
*
* + rounding to an increment (i.e. increment of 100 would round 1 to 100, 149 to 100, 150 to 200, etc) | class: 'gw-round-100'
* + rounding up by an increment (i.e. increment of 50 would round 1 to 50, 51 to 100, 149 to 150, etc) | class: 'gw-round-up-50'
* + rounding down by an increment (i.e. increment of 25 would round 1 to 0, 26 to 25, 51 to 50, etc) | class: 'gw-round-down-25'
* + rounding up to a specific minimum (i.e. min of 50 would round 1 to 50, 51 and greater would not be rounded) | class: 'gw-round-min-50'
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-field-specific-upload-paths.php
Created September 5, 2016 04:52 — forked from spivurno/gw-gravity-forms-field-specific-upload-paths.php
Gravity Wiz // Gravity Forms // Field-specific Upload Path
<?php
/**
* Gravity Wiz // Gravity Forms // Field-specific Upload Path
*
* Provides a method for specifying field-specific file upload paths.
*
* @version 1.0
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-user-specific-upload-paths.php
Created September 5, 2016 04:52 — forked from spivurno/gw-gravity-forms-user-specific-upload-paths.php
Gravity Wiz // Gravity Forms // User-specific Upload Paths
<?php
/**
* Gravity Wiz // Gravity Forms // User-specific Upload Paths
*
* Modifies the default Gravity Forms file upload path to user-specific (based on the user login) upload paths.
* If the user's login were "john315", the upload path would be ".../wp-content/uploads/john315/".
* If the user is not logged in, the default GF upload path will be used.
*
* @version 1.0
* @author David Smith <[email protected]>
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-get-custom-choices.php
Created September 5, 2016 04:54 — forked from spivurno/gw-gravity-forms-get-custom-choices.php
Gravity Wiz // Gravity Forms // Get Custom Choices Helper Function
<?php
/**
* Gravity Wiz // Gravity Forms // Get Custom Choices Helper Function
*
* A function that accepts a group name of one of your Gravity Form "Custom Choices" (http://grab.by/yNaS) and
* returns an array with the text and value options for each choice.
*
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
<?php
/**
* Gravity Wiz // Gravity Forms // Field-specific Upload Path
*
* Provides a method for specifying field-specific file upload paths.
*
* @version 1.0
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-populate-user-meta.php
Created September 5, 2016 04:54 — forked from spivurno/gw-gravity-forms-populate-user-meta.php
Gravity Wiz // Gravity Forms // Populate Field With User Meta
<?php
/**
* Gravity Wiz // Gravity Forms // Populate Field With User Meta
*
* Populate choice-based fields (i.e. drop downs, radios, checkboxes) with data from WordPress users.
*
* @version 1.0
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link http://gravitywiz.com/...