Skip to content

v0.11.0-alpha — custom-field sources: ACF, Meta Box & Pods

Pre-release
Pre-release

Choose a tag to compare

@Shepdesign Shepdesign released this 29 May 03:29
· 57 commits to main since this release

The custom-field source line lands: HOF now inspects ACF, Meta Box, and Pods fields and one-click-suggests facet configs — backed by an indexer that resolves ID-references to human labels and normalizes dates. Also includes the Divi bridge and an Action Scheduler-backed background reindex.

What's new

Source integrations — suggestion providers

Each integration inspects its plugin's registered fields and proposes ready-to-use facet configs over GET /integrations/{woocommerce,acf,metabox,pods}/suggest, gated by an is_active() check and a shared meta_in_use() data filter so only fields with real data are offered.

  • ACF — maps every meaningful field type to a display: select→dropdown, multi-select/checkbox→checkbox, radio/button_group→radio, true_false→toggle, number/range→range, text/textarea/email/url→search, taxonomy (Save Terms on)→taxonomy facet, relationship/post_object→resolve='post', user→resolve='user', Save-Terms-off taxonomy→resolve='term', date_picker/date_time_picker→date_range.
  • Meta Box — reads the meta_box registry; scalar/select/date/taxonomy types plus post/user (resolve) and taxonomy_advanced (comma-separated term IDs → resolve='term').
  • Pods — post-type Pod fields, including pick relationships mapped by pick_object (post→post, user→user, taxonomy→term). The meta_in_use() gate cleanly skips table-stored Pods fields this indexer can't serve.

Indexer — the resolve mechanism

  • ID → label resolution for meta facets whose values are IDs: 'post' (post title, via wp_posts), 'user' (display name, wp_users), and 'term' (term name + term_id, wp_terms) — resolved in one batched query per facet per reindex batch.
  • Serialized-array adapter — explodes ACF checkbox / multi-select arrays into one bucket per scalar value.
  • Comma-splitextract_ids() splits comma-separated ID strings so Meta Box taxonomy_advanced lands (a no-op for the plain-ID cases).
  • ACF date normalizationdate_picker's compact Ymd is parsed to a UTC-midnight epoch (round-trip validated), so date_range facets scale correctly.
  • Action Scheduler-backed background reindex — chunked, self-chaining full rebuilds under the hooked-on-facets group (with a wp_cron fallback), so large catalogs reindex without blocking a request.

Divi bridge

Divi core ships no scoped per-loop query filter, so the bridge splits Divi's two surfaces: Theme Builder archive/index templates run the main query (already filtered through QueryHook), and a Blog module on a page uses the global hof_divi_query_args() helper from the developer's own scoped pre_get_posts. Placement gets a native ET_Builder_Module (slug et_pb_hof_facet); the [hof_facet] shortcode remains a fallback.

Known limitations (deferred)

  • Divi Visual Builder — the native module is authored; its VB server-render path needs validation against a live Divi install.
  • Pods table / wp_podsrel storage, ACF/Meta Box time-of-day fields — deferred (see plan.md).

Upgrade

git pull && composer install && npm install

Schema bump to hof_db_version 1.2.0 runs automatically on load (the plugins_loaded auto-heal). A reindex picks up newly-suggested fields; suggestion providers are additive and never alter existing facets.


Full changelog: CHANGELOG.md