Skip to content

Instantly share code, notes, and snippets.

@spivurno
spivurno / gp-easy-passthrough-edit-entry.php
Last active November 10, 2021 19:39
Gravity Perks // Easy Passthrough // Edit Entry
<?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-easy-passthrough/gpep-edit-entry.php
*/
/**
* Gravity Perks // Easy Passthrough // Edit Entry
*
* Edit entry ID specified in field with current form submission.
@spivurno
spivurno / gist:47c700543e04b32229ca1b3d14d4ae4b
Created January 17, 2020 22:32
Modified WC_GFPA_Cart::enable_gform_after_submission_hooks() method.
private function disable_gform_after_submission_hooks( $form_id ) {
global $wp_filter, $wp_actions;
$tag = 'gform_after_submission';
if ( ! isset( $this->_wp_filters[ $tag ] ) ) {
if ( isset( $wp_filter[ $tag ] ) ) {
$this->_wp_filters[ $tag ] = $wp_filter[ $tag ];
unset( $wp_filter[ $tag ] );
}
}
$tag = "gform_after_submission_{$form_id}";
<?php
// Update "123" to your child form ID and "4" to the child File Upload field ID.
add_filter( 'gpnf_display_value_123_4', function( $value, $field, $form, $entry ) {
$value['label'] = sprintf( '<img src="%s">', $value['value'] );
return $value;
}, 10, 4 );
@spivurno
spivurno / hack-process-paypal-payments-locally.php
Created December 21, 2019 15:42
Hack: Process PayPal Payments Locally
<?php
/**
* Hack to process payment when returning to site from PayPal.
* http://gravitywiz.com/
*
* WARNING: This should only be used when testing on local sites.
*/
add_action( 'init', function() {
function gw_intercept_ipn_verification() {
<?php
/**
* Gravity Wiz // Gravity Forms // Map GF Checkbox Field to ACF Checkbox Field (User Meta)
* http://graivtywiz.com/
*/
add_filter( 'gform_user_registration_meta_value', function( $value, $meta_key ) {
// Update "checkboxes" to your custom field's name.
if( $meta_key === 'checkboxes' ) {
$value = array_map( 'trim', explode( ',', $value ) );
}
@spivurno
spivurno / gp-nested-forms-auto-attach-child-files.php
Last active October 10, 2021 10:36
Gravity Perks // Nested Forms // Auto-attach Uploaded Files from Child to Parent Notifications
<?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-nested-forms/gp-nested-forms-auto-attach-child-files.php
*/
/**
* Gravity Perks // Nested Forms // Auto-attach Uploaded Files from Child to Parent Notifications
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/
*/
@spivurno
spivurno / gw-gravity-forms-daily-form-schedule.php
Last active August 18, 2020 11:30
Gravity Wiz // Gravity Forms // Daily Form Schedule
<?php
/**
* Gravity Wiz // Gravity Forms // Daily Form Schedule
*
* Allow your form schedule to apply daily.
*
* @version 1.3
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link http://gravitywiz.com/
<?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-feed-specific-submit-button.php
*/
/**
* Gravity Wiz // Gravity Forms // Feed-specific Submit Button
*
* Change the label of the submit button depending on which payment feed will be used to process the order. This can help
<?php
/**
* Gravity Perks // GP Limit Submissions // Apply Limit Collectively to Group of Forms
* http://gravitywiz.com/documentation/gravity-forms-limit-submissions/
*/
add_filter( 'gpls_rule_groups', function( $rule_groups, $form_id ) {
// Update "123" to the ID of the form that will share its feeds with the other forms.
$primary_form_id = 123;