GravityView Advanced Filters Fields on Multiple Forms
Surfaces all Multiple-Forms joined form fields (including those from Gravity Flow) inside GravityKit Advanced Filtering / Query Filters field pickers
by Abundant Designs · github.com/robertstaddon/gravityview-advanced-filters-fields-on-multiple-forms · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/robertstaddon/gravityview-advanced-filters-fields-on-multiple-forms/archive/refs/heads/main.zipSurfaces Multiple-Forms joined-form fields and Gravity Flow Workflow Step inside GravityKit Advanced Filtering / Query Filters field pickers.
| Author | Abundant Designs |
| Version | 1.0.3 |
| License | GPL-2.0-or-later |
| Requires WordPress | 6.0+ |
| Requires PHP | 7.4+ |
| Tested up to | WordPress 6.7 |
Why this exists
When you build a Multi-Form View with GravityView Multiple Forms, the joined forms' field filters do not appear in the GravityKit Advanced Filtering pickers. As a result:
- Visibility → Conditional Logic on a field in the View editor only lists the primary form's fields, even after you select a joined form in the Form dropdown.
- The Sort & Filter metabox (Advanced Filter conditions) cannot use rows from joined forms.
- If a joined form has Gravity Flow steps, Workflow Step is missing from the picker even when the form has active steps.
This plugin fixes those gaps.
What it does
- Merges joined-form field rows into Advanced Filtering / Query Filters field pickers (Visibility, Sort & Filter, etc.).
- Backfills Gravity Flow
workflow_stepfor any form that has active steps but did not emit the row natively. - Adds joined forms to the Query Filters "Select form" dropdown when editing a Multi-Form View.
- Syncs the Visibility dialog so it uses the merged page payload (working around a stale-closure quirk in
advanced-filter.js).
How it works
The plugin hooks GravityKit's Query Filters pipeline. Order matters:
| Hook | Priority | Function | Purpose |
|---|---|---|---|
gk/query-filters/field-filters |
5 |
backfill_workflow_step_field_filter |
Add workflow_step for the primary form pipeline before merge runs (so a global "already present" check doesn't skip backfilling the primary). |
gk/query-filters/field-filters |
15 |
merge_joined_form_field_filters |
Merge each joined form's QueryFilters::create()->with_form(...)->get_field_filters() rows into the primary form's pipeline. View context is resolved from global $post, $_REQUEST['post'], or the admin referer query string (so AJAX requests work too). |
gk/query-filters/field-filters |
35 |
sanitize_field_filters_for_query_filters_ui |
Cast form_id to int (Svelte uses strict equality) and drop empty filters: [] arrays (JS treats [] as truthy and reroutes the row into the wrong optgroup). |
gk/query-filters/forms |
20 |
append_joined_forms_to_query_filter_forms |
Append joined forms to the "Select form" dropdown when the current View's primary form matches. is_admin() guard. |
admin_enqueue_scripts |
100 |
enqueue_visibility_field_list_sync_script |
Enqueue assets/js/visibility-field-list-sync.js (depends on gravityview_adv_filter_admin when registered) which calls updateFields(window.gkQueryFilters_advanced_filters.fields) whenever the Visibility dialog opens. |
Requirements
- WordPress 6.0+
- PHP 7.4+
- Gravity Forms
- GravityView
- GravityKit Advanced Filtering 3.0+ (uses
gk/query-filters/*hooks) - GravityView Multiple Forms 0.6+
- Optional: Gravity Flow — required for the
workflow_stepbackfill to do anything
Installation
- Copy the
gravityview-advanced-filters-fields-on-multiple-formsfolder towp-content/plugins/. - Activate the plugin in Plugins → Installed Plugins.
- Edit a Multi-Form View and confirm the joined forms' fields appear in:
- Field Visibility → Conditional Logic (form selector → joined form)
- Sort & Filter metabox (Advanced Filter conditions)
- (Optional) If you use Gravity Flow on the joined form, Workflow Step appears with each active step as a value option.
FAQ
Where does Workflow Step appear in the picker?
Most installs show it under Non-Field Data. In some Gravity Flow / Gravity Forms versions, the workflow_step row is emitted with a (sometimes empty) filters array, which the Query Filters Svelte UI uses to route the row into Form Fields. This plugin removes empty filters arrays so the row lands under Non-Field Data; if a non-empty nested tree is present, it stays under Form Fields. Either way, the row is selectable.
Will this affect frontend filtering?
The merged field list affects the picker UIs (what you can choose). Frontend filtering is implemented elsewhere (Advanced Filter _multi, Multiple Forms query builder, GravityView). For directory-vs-single-entry semantics in Multi-Form Views, see the GravityView Advanced Filter documentation; this plugin does not change those rules.
Does this plugin send data anywhere?
No. All processing is local to your WordPress install.
File layout
gravityview-advanced-filters-fields-on-multiple-forms/
├── gravityview-advanced-filters-fields-on-multiple-forms.php # Main plugin file (hooks, merge, backfill, sanitize, enqueue)
├── README.md # This file
└── assets/
└── js/
└── visibility-field-list-sync.js # Visibility dialog → updateFields() bridge
Internals reference
- Namespace:
AbundantDesigns\GVAdvFiltersFieldsOnMultipleForms - Text domain:
gv-adv-filters-fields-on-multiple-forms - Script handle:
gv-adv-filters-fields-on-multiple-forms-sync(look forid="gv-adv-filters-fields-on-multiple-forms-sync-js"in page source)
Changelog
1.0.3
assets/js/visibility-field-list-sync.jsis now cache-busted by the pluginVERSIONconstant instead of the file'sfilemtime(). BumpVERSIONwhen you ship JS changes.- Dropped the now-unused
file_exists()/filemtime()calls in the enqueue path.
1.0.2
- Removed all debug/logging code now that the integration is verified working.
- Removed the redundant
gravityview_adv_filter_admin↔gk-query-filtersdependency-wiring action — the sync script makes load-order independence explicit on its own. - Streamlined the merge/backfill/sanitize/enqueue paths and trimmed comments to only what's load-bearing.
1.0.1
- Renamed plugin to GravityView Advanced Filters Fields on Multiple Forms.
- Author / owner: Abundant Designs (abundantdesigns.com).
- Replaced
wp_add_inline_scriptwith a real enqueued JS file (assets/js/visibility-field-list-sync.js). - New text-domain and namespace.
1.0.0
- Initial release. Merge joined forms into Advanced Filtering / Query Filters pickers, backfill
workflow_step, append joined forms to the form selector.
License
GPL-2.0-or-later. Same license as WordPress, GravityView, and GravityKit Advanced Filtering.