BrightLeaf Digital Code Snippet Library

Check out our growing library of code snippets for Gravity Forms!





Like our snippets? You'll 💜 GravityOps!

A production-ready, client-first A/B testing utility designed for WordPress. This utility handles A/B test resolution in the browser, making it fully compatible with page caching (Cloudflare, Varnish, WP Rocket). --- USAGE: GUTENBERG BLOCKS --- 1. Create two blocks in the editor (e.g., two different Buttons). 2. In the "Advanced" sidebar for BOTH blocks, add the class: abtestcontainer-{slug} Example: abtestcontainer-hero-cta 3.

This snippet adds advanced search capabilities to the entries list page, allowing you to search by multiple criteria with ANY or ALL of the conditions evaluating to true.

This snippet allows you to bulk edit field properties like "Required," "Visibility," "Allow Duplicates" and more. It adds a small floating button to the side of each field. When you click on a button it opens a new tab in the sidebar where you can edit the desired settings. You can also select all, none or exit bulk edit mode

GOAL By default this code snippet automatically converts the value of a specific text field to uppercase before saving the entry in Gravity Forms. It ensures consistency in formatting and is particularly useful for fields like names, codes, or identifiers that require capitalization. Now also allows numerous other text manipulations and transformations:  Case transformations: uppercase, lowercase, title case, camelCase, PascalCase,

This snippet adds a setting to every GravityFlow workflow step to pause the entry on that step. Once paused the entry will not move on if it is not manually moved to a different step. Useful if a previous step encountered and error and was routed to a "failure" route, the entry can stay on the designated step until the

This snippet adds a widget to your admin dashboard and embeds your selected form in it. Works well with many add ons such as Nested Forms and Populate Anything and Live Merge Tags. Displays a custom confirmation with a link to the entry (opened in a new tab). Can easily reload the form after submissions. Triggers feeds and notifications and

Goal Show a simple popup based on three common behaviors: Exit intent (when a desktop user moves the mouse toward the browser’s top bar) Idle time (after a visitor hasn’t moved/typed/scrolled for N seconds) After scrolling a specified amount down the page. Keep everything self‑contained: the shortcode prints its own minimal CSS and JS inline. Work nicely with normal page

This code snippet adds an "Export Forms as Text" feature to Gravity Forms, allowing administrators to export form structures, confirmations, notifications, and workflow steps as a downloadable text file. This is useful for documentation, backups, or sharing form configurations without requiring JSON exports. Features Adds an Export Forms as Text tab in the Gravity Forms export menu. Allows selection of

Goal Provide a visual representation of field dependencies in the Gravity Forms editor. Make it easy to see where a field is used in conditional logic, calculations, and notifications. Give form editors a way to quickly audit references without opening every field or setting. Features Color-coded badges for different reference types (conditional logic, calculations, notifications). Interactive modal showing exactly which

This snippet fixes APC's handling of remote URL's in a file upload field. This snippet downloads the remote file and updates the local entry with the new local URL so that APC can access it and add it to the media library and post. This snippet can also be useful without APC when dealing with remote entry creation or updates

This snippet has been upgraded to a plugin for easier management and additional functionality. The plugin version also allows creating folders for Gravity View's. More features to come. Check it out here!     The Form Folders snippet allows admins to organize forms into folders for better management. It provides a user-friendly UI to create, view, rename, and delete folders,

BrightLeaf Digital GF Form Styler (Feed Add-On) Goal Provide a user-friendly, non-destructive way to style Gravity Forms without writing manual CSS. Allow granular control over form appearance at the global, field-type, and individual field levels. Ensure that styles are only applied when explicitly configured, preserving the theme's natural look by default. Features Integrated UI: A custom styling panel built directly

GFSearch This snippet has been replaced with a plugin version.

GOAL Adds a powerful "Advanced Conditional Groups" interface to the Gravity Forms editor. Allows for complex, nested "AND" and "OR" logic that isn't possible with standard settings. CONFIGURATION REQUIRED - Must be active alongside the "Gravity Forms Advanced Conditional Logic Runtime Engine" snippet. - Requires Gravity Forms to be installed and active. USAGE 1. Enable this snippet and the "Runtime

GOAL Provides the "engine" that makes advanced conditional logic work on your live forms. It handles both real-time showing/hiding of fields in the browser and secure enforcement of those rules when the form is submitted. CONFIGURATION REQUIRED - Must be active alongside the "Gravity Forms Advanced Conditional Logic Editor UI" snippet. - Requires Gravity Forms to be installed and active.

GOAL Adds "Export Layout" button to Gravity Forms editor that exports form structure as formatted HTML table to clipboard. Includes field labels, types, conditional logic, and Gravity Populate Anything (GPPA) settings for documentation purposes. USAGE Navigate to Forms > Edit Form in WordPress admin Click "📋 Export Layout" button in toolbar Script copies formatted table to clipboard Opens new Google

Creates a new merge tag-available anywhere, not just in standard Gravity Forms areas-that retrieves the specified GET parameter. It will look for "parameter name" in the query strings of the URL and replace the merge tag with the value for that paramater.

GOAL Prevents duplicate submissions when a specific combination of fields (Name, Number, Date) matches an existing active entry. If a duplicate is found, shows custom messages on the relevant fields. CONFIGURATION $forms: Add your form ID as a key, and set the field IDs to check. Then set the corresponding error messages. Optionally set the window_days key to limit check

GOAL This JavaScript snippet prompts users with a confirmation message before submitting a Gravity Form when they select a specific radio button choice. If the user selects a designated choice, a confirmation dialog appears, requiring them to confirm their selection before the form is submitted. This ensures that users intentionally proceed with their chosen option. Remember to update the choices and messages

GOAL This code snippet automatically capitalizes the first letter of each word in specified Gravity Forms fields before saving the entry. It ensures that user inputs, such as names or addresses, are stored in proper case formatting, enhancing data consistency and readability. Features Automatically applies proper case (capitalizes the first letter of each word). Works on specified form and field

GOAL Sends email notification to administrators whenever any form submission fails validation. Captures all failed fields with their labels and error messages, helping identify problematic forms, confusing validation rules, or user experience issues that need attention. CONFIGURATION $to: Add the recipient email address (in between the quotes) where notifications should be sent. Defaults to site admin email. $whitelist: Choose which

GOAL Alerts administrators when Gravity Forms fails to send email notifications. Critical for ensuring important notifications (confirmations, alerts, assignments) aren't silently lost. Includes full email details and error message to help diagnose SMTP/email configuration issues. DISCLAIMER This snippet only catches notifications that Gravity Forms detected as failed. It does not catch errors that occur during email sending, such as SMTP

GOAL Monitors donation/ledger forms for critical fields that have zero or empty values after submission. Sends email alert to administrators when amount fields are empty, which could indicate data loss, calculation errors, or payment processing issues. Includes user info and timestamp for debugging. CONFIGURATION $to: Add the recipient email address (in between the quotes) where notifications should be sent. Defaults

This snippet updates a post created by APC when the entry is updated.

GOAL This snippet ensures that specific groups of fields within a Gravity Forms form do not contain duplicate values. It allows you to define multiple sets of fields for validation, ensuring that no two fields within a group share the same value. If duplicates are found, a custom validation error message is displayed for each affected field. Features ✔ Prevents Duplicate Values – Ensures that no