Skip to content

Instantly share code, notes, and snippets.

David Smith spivurno

Block or report user

Report or block spivurno

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gp-limit-dates-mobile-styling-inline-datepicker.css
@media only screen and (max-width: 480px) {
.ui-datepicker {
width: 100%;
}
.ui-datepicker td span, .ui-datepicker td a {
width: auto;
display: block;
}
@spivurno
spivurno / gp-easy-passthrough-save-token-to-field.php
Created Jan 23, 2020
Gravity Perks // Easy Passthrough // Save EP Token to Field
View gp-easy-passthrough-save-token-to-field.php
<?php
/**
* Gravity Perks // Easy Passthrough // Save EP Token to Field
* http://gravitywiz.com/documentation/gravity-forms-easy-passthrough/
*
* This snippet allows you to populate the EP token into a field so it can be mapped in Gravity Forms feeds. The filter
* fires before feeds are processed so the token is available in time.
*/
// Update "123" to your form ID.
add_filter( 'gform_entry_post_save_123', function( $entry, $form ) {
View gw-gravity-forms-check-if-form-will-be-loaded.php
<?php
/**
* Gravity Wiz // Gravity Forms // Check If Form Will Be Loaded on Page
* http://gravitywiz.com/
*
* This snippet will allow you to check if a form will be loaded on the current page and do something if it will be.
* Note: this is a simple version that will only work on singular views where the [gravityforms] shortcode is used in
* the post content.
*
* @todo:
@spivurno
spivurno / gp-easy-passthrough-edit-entry.php
Last active Jan 23, 2020
Gravity Perks // Easy Passthrough // Edit Entry
View gp-easy-passthrough-edit-entry.php
<?php
/**
* Gravity Perks // Easy Passthrough // Edit Entry
*
* Edit entry ID specified in field with current form submission.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
@spivurno
spivurno / gist:47c700543e04b32229ca1b3d14d4ae4b
Created Jan 17, 2020
Modified WC_GFPA_Cart::enable_gform_after_submission_hooks() method.
View gist:47c700543e04b32229ca1b3d14d4ae4b
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}";
View gp-nested-forms-display-image-file-upload.php
<?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 Dec 21, 2019
Hack: Process PayPal Payments Locally
View hack-process-paypal-payments-locally.php
<?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() {
View gw-gravity-forms-checkbox-to-acf.php
<?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 Nov 2, 2019
Gravity Perks // Nested Forms // Auto-attach Uploaded Files from Child to Parent Notifications
View gp-nested-forms-auto-attach-child-files.php
<?php
/**
* Gravity Perks // Nested Forms // Auto-attach Uploaded Files from Child to Parent Notifications
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/
*/
add_filter( 'gform_notification', function( $notification, $form, $entry ) {
if( ! class_exists( 'GPNF_Entry' ) ) {
return $notification;
}
@spivurno
spivurno / gw-gravity-forms-daily-form-schedule.php
Last active Sep 30, 2019
Gravity Wiz // Gravity Forms // Daily Form Schedule
View gw-gravity-forms-daily-form-schedule.php
<?php
/**
* Gravity Wiz // Gravity Forms // Daily Form Schedule
*
* Allow your form schedule to apply daily.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/
You can’t perform that action at this time.