A library of powerful code snippets to help you get the job done with Gravity Forms and Gravity Perks.

Overview

Gravity Wiz Snippet Library

Gravity Wiz is creating the most comprehensive library of snippets for Gravity Forms ever.

We'll be consistently moving our nearly 500 snippets into the library as they receive updates. Only a small fraction of these snippets have been published on our blog.

We're sorcerously excited to introduce you to the magical might of Gravity Forms and Gravity Perks! With a perk here and snippet there, you'll be building solutions you never thought you could before. Your clients, bosses, and mothers are going to be so proud of you.

Go ahead, start exploring our ancient brand new library of Gravity Forms spells and unlock your true potential.

FAQs

How do I get help with a snippet?

If you're a Gravity Perks customer with an Advanced or Pro license, we'll be happy to help you via our support form. Not ready to join the Gravity Wiz family? Some snippets have articles on our blog where you can post a comment about your issue. Look for the URL in the snippet header.

Comments
  • Create gw-set-product-category.php

    Create gw-set-product-category.php

    There are several drop down fields. Each subsequent one is filled from the parent by Term_ID using populate anything. In the feed settings, when using this code, you can not specify in which categories the product will be recorded.

    Context

    ⛑️ Ticket(s): https://secure.helpscout.net/link/to/conversation

    📓 Notion: https://notion.so/link/to/card

    💬 Slack: https://slack.com/link/to/thread-or-message

    Summary

    opened by zippa71 8
  • Create gfcs-auto-select-only-choice.php.

    Create gfcs-auto-select-only-choice.php.

    Context

    ⛑️ Ticket(s): https://secure.helpscout.net/conversation/2049282106/40053?folderId=14965

    Summary

    The Gravity Forms Chained Selects field requires you to manually select a value in each Drop Down even if there is only a single option available in that Drop Down. This snippet will automatically selected an option when it is the only option available.

    opened by guilamu 8
  • Added `gpepee_edit_entry_id` filter to allow modifying the entry ID used to target the entry to be edited.

    Added `gpepee_edit_entry_id` filter to allow modifying the entry ID used to target the entry to be edited.

    HS#29155

    User wanted to conditionally edit the entry. This filter will allow him to do this with the following sample code:

    add_filter( 'gpepee_edit_entry_id_123', function( $update_entry_id, $form_id ) {
    	// Update "4" to the field ID you want to check the value of.
    	if ( rgpost( 'input_1' ) === 'Add New' ) {
    		$update_entry_id = false;
    	}
    	return $update_entry_id;
    }, 10, 2 );
    

    One sneaky but significant change I made in this PR (unrelated to the filter) is changing from which form the edit entry ID is fetched when fetching from the session. For some reason, it was setup to pull from the target form's session rather than the source form's session.

    This doesn't make sense as the entire point of the snippet is to edit the same entry that has been populated into the form. I suspect most users are using the token or logged-in user's last entry option which were functioning correctly.

    opened by spivurno 8
  • `gpnf-auto-attach-child-files`: Refactored for greater configuration flexibility.

    `gpnf-auto-attach-child-files`: Refactored for greater configuration flexibility.

    Context

    ⛑️ Ticket(s): https://secure.helpscout.net/conversation/2011825626/38759/

    Summary

    • Refactors gpnf-auto-attach-child-files into a class.
    • Moves configuration logic to constructor args so that users can easily create multiple, unique configurations.
    • Adds child_form_upload_field_ids config option to limit which child form upload fields are included in a notification.
    opened by veryspry 6
  • Fixed issue where autocomplete was not disabled in Chrome.

    Fixed issue where autocomplete was not disabled in Chrome.

    Chrome seems to have changed their mind again about which autocomplete keywords they'll honor and ignore. Looks like "off" is working again.

    opened by spivurno 6
  • Added GPNF Delay Child Notifications to the library

    Added GPNF Delay Child Notifications to the library

    This PR imports the GPNF Delay Child Notifications for Parent Payment snippet.

    It also fixes an issue where notifications were sent twice by filtering on gform_entry_post_save and specific parent form IDs.

    #23899 / DWC.

    opened by eihabi 6
  • Update gpml-change-upload-directory.php

    Update gpml-change-upload-directory.php

    Good afternoon. This code works well, but the changed path (/wp-content/uploads/images/id91e8cc636fab491e8cd/file.png ) of the photos is displayed only in the frontend. In the administrative part of the site, in the product card, photos still have paths like /wp-content/uploads/2022/11/file.png

    I added an additional code, now in the administrative part in the product card the path to the photos is the same as in the frontend.

    Context

    ⛑️ Ticket(s): https://secure.helpscout.net/link/to/conversation

    📓 Notion: https://notion.so/link/to/card

    💬 Slack: https://slack.com/link/to/thread-or-message

    Summary

    opened by zippa71 5
  • Fixed an issue where uploaded files were not attached to parent notification in `gp-nested-forms-auto-attach-child-files`.

    Fixed an issue where uploaded files were not attached to parent notification in `gp-nested-forms-auto-attach-child-files`.

    This PR migrates the gp-nested-forms-auto-attach-child-files snippet to the library.

    It also fixes a configuration issue where uploaded files were not attached to the parent form due to a notification ID check. By removing this check, once the snippet is enabled, any form that contains a child form will have uploaded files attached when this snippet is enabled.

    Source: https://gist.github.com/spivurno/89efb788d3dc54a35ac001ad13322a74 Ticket: #27868

    opened by eihabi 4
  • Added support for bypassing Limit Submissions feeds when editing an entry.

    Added support for bypassing Limit Submissions feeds when editing an entry.

    HS#25575

    This PR adds support for bypassing GP Limit Submissions feeds when editing an entry. It does some significant refactoring so we'll want to retest these three scenarios.

    1. Default functionality — updating an entry.
    2. Deleting a partial entry when Partial Entries is active and delete_partial parameter is true.
    3. Limit Submission feeds are bypassed when editing an entry.
    opened by spivurno 4
  • `gpnf-override-parent-merge-tag-on-submission`: Updated to a class and made configuration for multiple child forms easier.

    `gpnf-override-parent-merge-tag-on-submission`: Updated to a class and made configuration for multiple child forms easier.

    Context

    ⛑️ Ticket(s): https://secure.helpscout.net/conversation/2015154047/38861/

    It is difficult to configure gpnf-override-parent-merge-tag-on-submission.php for multiple child forms. This enables users to more easily apply the logic to multiple child forms.

    Summary

    • Refactors the snippet to a class to match our preferred snippet style.
    • Support instantiating one instance of GPNF_Override_Parent_Merge_Tags per child form a user wants to configure.
    • Support instantiating a single instance of GPNF_Override_Parent_Merge_Tags with no arguments to apply this to all child forms.
    opened by veryspry 3
  • Fixed errors generated when init scripts are included multiple times.

    Fixed errors generated when init scripts are included multiple times.

    HS#32379

    Nested Forms wasn't playing nice with Cache Buster due to its init script being bound and called multiple times and the Nested Form field container not existing. The latter issue is addressed in this PR.

    With the existing implementation, all init scripts were loaded and triggered in the footer on the initial page load and then were re-included and re-triggered in the AJAX request that fetches the form markup. I'm honestly surprised we haven't been running into more issues like this.

    image

    My solution is to:

    • allow the default init scripts to be output to the footer
    • suppress the default init script trigger (e.g. gform_post_render)
    • suppress init scripts during the AJAX request so they are not re-included
    • manually trigger init scripts (via gform_post_render) after we've included the fetched markup

    An alternate approach would be to suppress both the init scripts and default init script trigger and allow both to be included/executed as part including the markup from the AJAX request in the page but there have been some ambiguous issues with this approach in the past. Nested Forms itself deliberately moved away from that flow and seems to be much more stable now.

    My only lingering concern is that since the default init scripts are output to the footer on page load, they will be cached. This may be an issue for plugins like Populate Anything that output dynamic data. I couldn't recreate a specific issue though so let me know if you can.

    opened by spivurno 3
  • `gppa-force-gppa-on-save-and-continue.php`: Added snippet to force GPPA value over a Save & Continue Value.

    `gppa-force-gppa-on-save-and-continue.php`: Added snippet to force GPPA value over a Save & Continue Value.

    Context

    ⛑️ Ticket(s): https://secure.helpscout.net/conversation/2099104029/41936?folderId=3808239

    Summary

    When resuming a Save & Continue session, GPPA-populated fields correctly honor the Save & Continue value. This snippet would force GPPA to repopulate the field, ignoring the Save & Continue value.

    The snippet in Action: https://www.loom.com/share/6ccde3a615234810b086a41f3c029f2d

    opened by saifsultanc 3
  • `gpfr-allow-commas.php`: Added initial support.

    `gpfr-allow-commas.php`: Added initial support.

    Context

    ⛑️ Ticket(s): https://secure.helpscout.net/conversation/2103452211/42095/

    Summary

    • Relies on a new, unreleased filter in GPFR called gpfr_sanitize_file_name_chars.
    • Removes commas from the list of dissallowed characters when renaming files with GPFR.
    opened by veryspry 0
  • `gppa-strip-slashes-from-result-value.php`: Added snippet to strip slashes from GPPA populated value.

    `gppa-strip-slashes-from-result-value.php`: Added snippet to strip slashes from GPPA populated value.

    Context

    ⛑️ Ticket(s): https://secure.helpscout.net/conversation/2096156781/41821?folderId=3808239

    Summary

    Strip slashes from GPPA populated value. Possible enhancements to look at could include running over all fields and detecting the existence of specific patterns of values which need to be decoded/strip slashes from.

    opened by saifsultanc 1
  • `gw-advanced-merge-tags.php`: Added support for `:mask` modifier.

    `gw-advanced-merge-tags.php`: Added support for `:mask` modifier.

    Context

    ⛑️ Ticket(s): https://secure.helpscout.net/conversation/2079000554/41152/

    Summary

    Customer wanted a way to provide a hint of the field's value while masking most of it for privacy.

    Added the :mask modifier which will show the first and last letter and replace the rest of the output with asterisks. For email values, it splits the username and domain and masks them separately.

    CleanShot 2022-11-28 at 21 36 16

    opened by spivurno 1
  • `gpecf-deduct-deposit.php`: Updated snippet to prevent fatal error when Gravity Forms is disabled.

    `gpecf-deduct-deposit.php`: Updated snippet to prevent fatal error when Gravity Forms is disabled.

    Context

    ⛑️ Ticket(s): https://secure.helpscout.net/conversation/2075899506/40995?folderId=3808239

    Summary

    Check for Gravity Forms before initializing to prevent fatal errors, if Gravity Forms is not enabled.

    opened by saifsultanc 0
  • `gw-populate-date.php`: Updated snippet to tap dynamic content loaded by field value modifier.

    `gw-populate-date.php`: Updated snippet to tap dynamic content loaded by field value modifier.

    Context

    ⛑️ Ticket(s): https://secure.helpscout.net/conversation/2070005018/40733?folderId=3808239

    Summary

    If the source date is selected, a change in modifier value (in the field with GPPA Field Value Objects) does not update the target date.

    opened by saifsultanc 0
Owner
Gravity Wiz
Gravity Wiz is a small company dedicated to providing awesome Gravity Forms resources in the form of snippets, tutorials and plugins.
Gravity Wiz
Bug bounty tools built in PHP to help penetration tester doing the job

BugBountyTools-PHP Bug bounty tools built in PHP to help penetration tester doing the job Website who using this script: KitaBantu Soon! 403 Bypasser

Muhammad Daffa 7 Aug 17, 2022
Easily create and work with code snippets from PHP

code-snippets Easily create and work with code snippets from source code files of any type in PHP. The original code this package is based on was borr

Permafrost Software 8 Sep 4, 2022
Custom code snippets and examples for SkyVerge-built WooCommerce extensions

SkyVerge WooCommerce Plugins Welcome to the wc-plugins-snippets repository! This repository stores code snippets related to SkyVerge WooCommerce plugi

SkyVerge 255 Nov 16, 2022
Demo serverless applications, examples code snippets and resources for PHP

The Serverless LAMP stack Examples Code example Description AWS blog link 0.1-SimplePhpFunction A very simple implementation of a PHP Lambda function.

AWS Samples 303 Dec 20, 2022
This Kirby V3 Plugin brings snippets and blueprints together in one place. It includes useful tools that completely changing the way you work with Kirby: Fast and well organized.

Kirby Components Overview Do you love to make awesome projects with Kirby CMS? Do you also find it difficult to switch between snippets and blueprints

Roman Gsponer 6 May 31, 2023
A self-hosted alternative to putting your code snippets on Gist.

WP-Gistpen Contributors: JamesDiGioia Donate link: http://jamesdigioia.com/ Tags: gist, code snippets, codepen Requires at least: 5.2 Requires PHP: 5.

Intraxia 71 Nov 15, 2022
Iran decoration platform is an open source Php web application where you can find your job as a freelancer working in people home in decoration positions and others.

Iran-Decoration Platform Iran decoration platform is an open source Php web application where you can find your job as a freelancer working in people

AmirHossein Mohammadi 8 Dec 14, 2022
WebAgency certificate results done by Mickaël Moreau, delivred by Axelo (web-agency.app)

WebAgencyCertificate WebAgency certificate results done by Mickaël Moreau, delivred by Axelo (web-agency.app) Résultat du certificat en pré-production

Mickaël Moreau 1 Sep 20, 2022
TPI - News website done is the context of my CS studies

tpi-news-website TPI - News website done is the context of my CS studies IceScrum Software Used Documentation Text editing Microsoft Office 365 suite

Louis Richard 0 Sep 29, 2022
🔒 a simple login screen done in php with connection to mysql

login.php What is a login system? login (derived from the English log in) or logon or signin, is the process to access a restricted computer system ma

SEBASTIAN JN 3 Aug 21, 2022
Better Moderation, moderation just done better.

Better Moderation Plugin Commands /ban <player> <reason> <time> - Bans a player from the server. /blacklist <player> - Blacklists a player from the se

Colby Pham 5 Jun 15, 2023
PHP library for Disque, an in-memory, distributed job queue

disque-php A PHP library for the very promising disque distributed job queue. Features: Support for both PHP (5.5+) and HHVM No dependencies: Fast con

Mariano Iglesias 132 Oct 19, 2022
⭐ It is an platform for people to help them get connected with the like minding folks around the globe.

Meetups It is an Platform for people to help them get connected with the like minded folks around the globe. Live on Web: Cick here ?? Meet and Connec

Hardik Kaushik 5 Apr 26, 2022
A helpful Laravel package to help me get started in Laravel projects quicker.

Launchpad A helpful Laravel package to help me get started in Laravel projects quicker. This is still a work in progress, so use at your own risk! CLI

Steve McDougall 13 Jun 15, 2023
This simple code lets you to get how many % of this year had passed

Year-Percent-PHP This simple code lets you to get how many % of this year had passed Code is part of Telegram bot and was made for Telegram channel Ye

Puzzak 1 Jan 3, 2022
Collection of useful PHP functions, mini-classes, and snippets for every day.

JBZoo / Utils Collection of PHP functions, mini classes and snippets for everyday developer's routine life. Install composer require jbzoo/utils Usage

JBZoo Toolbox 786 Dec 30, 2022
Collection of PHP functions, mini classes and snippets for everyday developer's routine life

JBZoo / Utils Collection of PHP functions, mini classes and snippets for everyday developer's routine life. Install composer require jbzoo/utils Usage

JBZoo Toolbox 776 Jun 2, 2022
⚡ Php snippets, random stuff, demos, functions, fast message system, agnostic and framework free - 100% compactible ;) ⚡

⚡ Php8 FPM Nginx Fast, Scripts, Pearls & Treasures ?? Want to run and test asap ? docker-compose up -d phpgit_php8;ip=$(docker-machine ip default);ech

Benjamin FONTAINE 0 Mar 20, 2022
MagentoSnippets - Magento Front End Snippets, plugin for Sublime Text

MagentoSnippets Magento Front End Snippets, plugin for Sublime Text. This tool serves to aid the productivity during the Magento's theme development t

MageFront 27 Nov 1, 2022