Skip to content

Instantly share code, notes, and snippets.

@spivurno
spivurno / gp-copy-cat-gppc_copied_value.html
Created May 12, 2017 01:37
Gravity Perks // GP Copy Cat // Modify Copied Value
<script type="text/javascript">
// [email protected] => gravitywiz.com
gform.addFilter( 'gppc_copied_value', function( value, $elem, data ) {
if( data.target == 2 && value ) {
value = value.split( '@' )[1];
}
return value;
} );
@spivurno
spivurno / gw-gravity-forms-rotating-values.php
Last active September 1, 2021 20:54
Gravity Wiz // Gravity Forms // Rotating Values
<?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-round-robin.php
*/
/**
* Gravity Wiz // Gravity Forms // Rotating Values
* http://gravitywiz.com/
*/
@spivurno
spivurno / gp-better-user-activation-enable-editor.php
Last active September 19, 2022 19:14
Gravity Perks // GP Better User Activation // Enable Editor on Activation Page
<?php
/**
* Gravity Perks // GP Better User Activation // Enable Editor on Activation Page
* http://gravitywiz.com/documentionat/gravity-forms-better-user-activation/
*/
add_action( 'init', function() {
if ( is_callable( 'gp_better_user_activation' ) ) {
remove_action( 'admin_head', array( gp_better_user_activation(), 'remove_default_content_editor' ) );
}
} );
@spivurno
spivurno / gp-post-content-merge-tags-save-confirmation-url-to-field.php
Created April 28, 2017 13:27
Gravity Perks // GP Post Content Merge Tags // Save Confirmation URL to Field
<?php
/**
* Gravity Perks // GP Post Content Merge Tags // Save Confirmation URL to Field
* http://gravitywiz.com/documentation/gravity-forms-post-content-merge-tags/
*/
// 1. Update "123" to your form ID.
add_filter( 'gform_entry_post_save_123', function( $entry ) {
// 2. Update this to your desired URL.
$url = 'http://yoururl.com/';
@spivurno
spivurno / gw-gravity-forms-cache-buster.php
Last active June 8, 2021 19:09
Gravity Wiz // Gravity Forms // Cache Buster
<?php
/**
* Gravity Wiz // Gravity Forms // Cache Buster
*
* Bypass your website cache when loading a Gravity Forms form.
*
* @version 0.2
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link http://gravitywiz.com/
@spivurno
spivurno / gp-ecommerce-fields-gpecf-order-labels.php
Created April 21, 2017 21:10
Gravity Perks // GP eCommerce Fields // Modify Order Labels
<?php
/**
* Gravity Perks // GP eCommerce Fields // Modify Order Labels
* http://gravitywiz.com/documentation/gravity-forms-ecommerce-fields/
*/
add_filter( 'gpecf_order_labels', function( $labels ) {
$labels['order'] = 'Le Order';
$labels['product'] = 'Le Product';
$labels['quantity'] = 'Le Quantity';
$labels['unit_price'] = 'Le Unit Price';
@spivurno
spivurno / gp-media-library-acf-user-image-field.php
Last active November 30, 2021 18:04
Gravity Perks // GP Media Library // Populate ACF Image Fields in User Profile
<?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/gp-media-library/gpml-acf-user-image-field.php
*/
/**
* Gravity Perks // GP Media Library // Populate ACF Image Fields in User Profile
* http://gravitywiz.com/documentation/gp-media-library/
*
@spivurno
spivurno / gp-media-library-attach-media.php
Last active July 17, 2020 08:12
Gravity Perks // GP Media Library // Auto-attach Uploaded Files to GF-generated Post
</php
/**
* Gravity Perks // GP Media Library // Auto-attach Uploaded Files to GF-generated Post
* http://gravitywiz.com/documentation/gp-media-library/
*/
add_action( 'gform_after_create_post', function( $post_id, $entry, $form ) {
if( is_callable( 'gp_media_library' ) ) {
$file_ids = gp_media_library()->get_file_ids_by_entry( $entry, $form );
if( $file_ids ) {
foreach( $file_ids as $field_id => $_file_ids ) {
@spivurno
spivurno / gw-gravity-forms-hide-field-on-entry-detail.php
Last active April 11, 2017 02:35
Gravity Wiz // Gravity Forms // Hide Field on Entry Detail
<?php
/**
* Gravity Wiz // Gravity Forms // Hide Field on Entry Detail
* http://gravitywiz.com/
*/
// update "123" to your form ID; "6" to your field ID.
add_filter( 'gform_field_content_123_6', function ( $field_content, $field ) {
if ( $field->is_entry_detail() ) {
$field_content = '';
}
@spivurno
spivurno / gp-limit-checkboxes-conditional-limits.php
Last active October 12, 2021 14:54
Gravity Perks // GP Limit Checkboxes // Conditional Limits
<?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/gp-limit-checkboxes/gplcb-conditional-limits.php
*/
/**
* Gravity Wiz // Gravity Perks // GP Limit Checkboxes // Conditional Limits
*
* Provide conditional min/max for your checkbox fields.