DOCS

Filter Bar

> Requires: Fundations Pro

The Filter Bar is a Pro block (get-fund/filter-bar) that adds live search and filter controls to any page displaying a list of fundations, events, or organisations. Visitors can filter by keyword, organisation, creator, event, or category without the page reloading.

Why use this

Archive pages with many fundations are hard to navigate without filtering. The Filter Bar lets visitors narrow down the list interactively, which helps on large fundraising platforms.

What it does

The block renders up to five filter controls:

ControlFilters byURL parameter
SearchFundation title and contentgf_search
OrganisationCreator organisation (from user meta get_fund_organisation_title)gf_org
CreatorSpecific fundraiser by namegf_creator
EventThe get_fund_event a page belongs togf_event
CategoryThe get_fund_category a page belongs to, and its descendantsgf_category

The Category control only appears when Categories are enabled in Fundations settings. Its dropdown is indented to show the nesting, and selecting a parent category matches every fundation under it and its sub-categories.

When a visitor applies a filter, the block uses fetch() and history.pushState() to update the listing without a full reload. The URL is updated so the filtered view is bookmarkable and shareable. Browser back and forward navigation is supported. Search input is debounced by 400ms.

Pagination links within the swapped content are also intercepted so navigating pages of results stays consistent.

Where it works

The Filter Bar adapts to the archive it sits on. It applies to queries from WordPress Query Loop blocks and Greenshift query blocks, for three post types:

ArchivePost typeWhat the filters narrow to
Fundationsget_fund_actionThe matching fundations directly.
Eventsget_fund_eventThe events that contain matching fundations.
Organisationsget_fund_orgThe organisations that own matching fundations.

On the Events and Organisations archives, each filter dimension is mapped back through the fundations it matches, so filtering by an event or category on the organisations archive shows only the organisations running pages that match. Queries for any other post type are left untouched.

Multiple Filter Bar blocks can appear on the same page.

How to use it

  1. Open the page where your fundation archive is displayed in the block editor.
  2. Find the Filter Bar block in the Fundations block category and insert it above your Query Loop.
  3. In the block settings panel, toggle which controls to show (Search, Organisation, Creator, Event, Category).
  4. Optionally set custom labels for each control.
  5. Adjust styling options (border radius, colors) to match your theme.
  6. Save and preview.
Filter bar block editor
Filter bar frontend

Settings & options

AttributeTypeDefaultDescription
showSearchbooleantrueShow the search input
showOrganisationbooleantrueShow the organisation dropdown
showCreatorbooleantrueShow the creator dropdown
showEventbooleantrueShow the event dropdown
showCategorybooleantrueShow the category dropdown (only renders when Categories are enabled)
searchLabelstring(empty)Label for the search field
orgLabelstring(empty)Label for the organisation dropdown
creatorLabelstring(empty)Label for the creator dropdown
eventLabelstring(empty)Label for the event dropdown
categoryLabelstring(empty)Label for the category dropdown
borderRadiusinteger50Border radius in pixels
borderColorstring#e5e7ebBorder color
backgroundColorstring#ffffffBackground color of the controls
textColorstring#374151Text color
placeholderColorstring#9ca3afPlaceholder text color

What you can and cannot do

  • You can show or hide any of the five filter controls independently.
  • You can override the label text for each control.
  • You can style the controls to match your theme using the color and border options.
  • You can place the bar on the Fundations, Events, or Organisations archive; it adapts to each.
  • You cannot add custom filter dimensions beyond the five built-in controls.
  • You cannot filter by donation amount range or goal completion status.
  • The Category control only appears when Categories are enabled in Fundations settings.
  • The Organisation filter uses the get_fund_organisation_title user meta field. If your users do not have this meta set, the dropdown will be empty.

Examples

Search only: disable Organisation, Creator, and Event in the block settings. Only the search bar appears. Useful for smaller sites.

Event-based filtering: leave only the Event control enabled and set the label to “Filter by cause”. Pair with a Query Loop filtered to a specific event term for focused browsing.

Troubleshooting

Filters apply but the list does not update. Check that your Query Loop block is on the same page and is set to query get_fund_action post type. The Filter Bar looks for .wp-block-query, [class*="gspb_queryBlock"], or .get-fund-org-card-wrapper containers to update.

The Organisation dropdown is empty. Users need the get_fund_organisation_title user meta populated. This is set through the fundraiser profile. If your site does not use organisations, disable this control in the block settings.

Filtering works on the first visit but breaks after a page reload with filters in the URL. The server-rendered initial page load applies the URL parameters correctly. If you see issues, confirm the Filter Bar block is loading its JavaScript. Check the browser console for errors.

Browser back button does not restore the previous filter state. The Filter Bar uses popstate event handling. If another plugin or theme is interfering with the History API, this may break. Test with other plugins deactivated.

Developer reference

REST API endpoint

The Filter Bar fetches dropdown options via a public REST endpoint:

GET /wp-json/get-fund/v1/filter-options

Response shape:

{
  "orgs": ["Org Name 1", "Org Name 2"],
  "creators": [
    { "id": 1, "name": "Fundraiser Name" }
  ],
  "events": [
    { "id": 5, "name": "Event Name" }
  ],
  "categories": [
    { "id": 9, "name": "Animals" },
    { "id": 12, "name": "— Dogs" }
  ]
}

The categories array is present only when Categories are enabled, and its names are indented with a leading em dash to show nesting. The endpoint is unauthenticated, cached, and rate-limited. No nonce is required.

URL parameters

ParameterUsed for
gf_searchKeyword search
gf_orgOrganisation name string
gf_creatorCreator user ID
gf_eventEvent post ID
gf_categoryCategory post ID (matches the category and its descendants)

Query integration hooks

The Filter Bar integrates with the WordPress block query system:

HookPurpose
query_loop_block_query_varsApplies filters to WordPress Query Loop
gspb_module_args_queryApplies filters to Greenshift module queries
gspb_query_block_argsApplies filters to Greenshift query block args

The Filter Bar modifies queries for get_fund_action (fundations), get_fund_event (events), and get_fund_org (organisations). Category resolution delegates to the free plugin’s Get_Fund_Block_Editor::get_category_fundation_ids(), so descendant scoping stays consistent between the free templates and the Pro filter.

No additional hooks or filters are exposed by this class.