BrightLeaf Digital Code Snippet Library

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





Like our snippets? You'll 💜 GravityOps!

Goal Use the simple shortcode [export_filtered_entries] to render a button that triggers a CSV download of the entire GravityView dataset matching the current filters/search. Requirements GravityView and Gravity Forms active. The shortcode should be used on a page where a GravityView is present, or provide view_id/form_id via attributes. Notes For filtered exports, the shortcode MUST be placed on the same

Goal 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

Goal This snippet creates a special merge tag syntax for GravityMath shortcodes. This is necessary when nesting GravityMath shortcodes inside a GravityOps Search (https://brightleafdigital.io/gravityops-search/) display attribute. See here (https://brightleafdigital.io/docs/nesting-shortcodes/#1-toc-title) for more info. The syntax for the new merge tags is as follows: It needs to be wrapped in ~ before and after the merge tag It needs the gos prefix

Goal Create a custom merge tag that outputs a secure GravityView Edit Entry link for the current entry when displayed inside a GravityView context. The snippet registers the merge tags: {gview_edit_entry_link} {gview_edit_entry_link:Link Text} These tags generate an edit link to the current entry within the active GravityView. Usage {gview_edit_entry_link:Your Link Text} {gview_edit_entry_link:Update your submission} Default Behavior If no link text

Goal 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 This code snippet renames the "Workflow Complete" step in Gravity Flow by dynamically replacing it with the actual name of the last completed step in the workflow. This ensures that users see a meaningful step name rather than the generic "Workflow Complete" label when viewing GravityView entries. Configuration $form_ids: Update to the list of form IDs this should apply

Goal This code snippet enhances Gravity Flow by allowing workflows to be delayed or restarted based on GravityView approval and subscription payments. It provides options to: Delay workflow initiation until an entry is approved in GravityView instead of starting upon form submission. Restart the workflow upon each subscription payment for recurring payment scenarios. Update a date field when the workflow

Goal This is the snippet that powers this snippet directory. The snippet is installed as custom code on a Gravity View and fetches the code from GitHub and displays it in the specified HTML element in this case the code box. The code box is created mostly through CSS.

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