This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste this into your browser DevTools console while editing a form in Gravity Forms | |
// Load fast-xml-parser | |
jQuery.getScript( | |
"https://cdnjs.cloudflare.com/ajax/libs/fast-xml-parser/4.0.8/fxparser.js", | |
function () { | |
// Loop through HTML fields in window.form.fields | |
window.form.fields.forEach(function (field) { | |
if (field.type !== "html") { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.table-of-contents { | |
position: sticky; | |
top: 2.25rem; | |
overflow-y: auto; | |
max-height: calc(100vh - 2.25rem); | |
margin-top: 2.25rem; | |
padding-bottom: 2.25rem; | |
box-sizing: border-box; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_checkout_get_value', function( $input, $key ) { | |
// Get current items in the cart. | |
$cart_items = WC()->cart->get_cart(); | |
// Loop through cart items. | |
foreach ( $cart_items as $cart_item ) { | |
// Convert to a GSPC Cart Item | |
$gspc_cart_item = \GS_Product_Configurator\WC_Cart_Item::from( $cart_item ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Shop // GS Product Configurator // Populate Gravity Forms field with WooCommerce Order ID | |
* | |
* Populate fields in a Gravity Form that is linked to a WooCommerce product using GS Product Configurator | |
* with the WooCommerce order ID after checking out. | |
* | |
* Credit: Rochelle Victor (https://github.com/rochekaid) | |
* | |
* Instructions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Wiz // Gravity Forms OpenAI // Add separator to prompt | |
* https://gravitywiz.com/path/to/article/ | |
* | |
* Adds a separator to a prompt if needed by a fine-tuned model. | |
* | |
* Instructions: | |
* 1. Customize $model and $sep accordingly. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Perks // GP Notification Scheduler // Set Recurring Schedule to Every 6 Months | |
* https://gravitywiz.com/documentation/gravity-forms-notification-scheduler | |
* | |
* Instructions: | |
* * Install snippet per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/ | |
* * Update $form_id, $notification_id, and if required, $desired_time | |
*/ | |
add_filter( 'gpns_schedule_timestamp', function ( $timestamp, $notification, $entry, $is_recurring, $current_time ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gravity Perks // GP Address Autocomplete // Show Cities as Results | |
* https://gravitywiz.com/documentation/gravity-forms-address-autocomplete | |
* | |
* Instructions: | |
* 1. Install our free Custom JavaScript for Gravity Forms plugin. | |
* Download the plugin here: https://gravitywiz.com/gravity-forms-custom-javascript/ | |
* 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin. | |
* 3. Install accompanying gpaa-autocomplete-cities.php snippet | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get Gravity Forms Field by Label | |
* @link https://gravitywiz.com | |
* | |
* @param array|int $form_or_id The Form Object or ID. | |
* @param string $search The field label to search by. | |
* @param string $label_property The property from the field to search using. Defaults to "label". Set to "adminLabel" | |
* to search by the admin label. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gravity Perks // GP Populate Anything // Automatically Check Checkboxes | |
* http://gravitywiz.com/documentation/gravity-forms-populate-anything | |
* | |
* Instructions: | |
* 1. Install our free Custom Javascript for Gravity Forms plugin. | |
* Download the plugin here: https://gravitywiz.com/gravity-forms-custom-javascript/ | |
* 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin. | |
*. 3. This snippet is meant to be a starting point. You will need to update the selectors accordingly | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Set Surrogate-Control header on pages with Gravity Forms to prevent Varnish from caching. | |
* | |
* This requires Varnish to be configured to utilize Surrogate-Control when present. | |
* | |
* See the follow material for more details: | |
* * https://developer.fastly.com/reference/http-headers/Surrogate-Control/ | |
* * https://book.varnish-software.com/4.0/chapters/VCL_Basics.html#vcl-backend-response | |
*/ |
NewerOlder