Architecture

How OpenFields works under the hood.

Overview

OpenFields consists of two main parts:

  • PHP Plugin — Handles field storage, REST API, and meta box rendering
  • React Admin — Modern UI for managing field groups and fields

Database Schema

OpenFields uses three custom tables:

wp_openfields_fieldsets

Stores field group definitions.

wp_openfields_fields

Stores field definitions within groups.

wp_openfields_locations

Stores where field groups appear.

Meta Storage

Field values are stored in standard WordPress meta tables:

  • wp_postmeta — for posts/pages
  • wp_usermeta — for users
  • wp_termmeta — for taxonomy terms

Values are stored directly under the field name (no prefix), making them ACF-compatible.

REST API

The React admin communicates with WordPress via REST API.

Location Matching

When WordPress loads a post edit screen, OpenFields determines which field groups to show:

  1. Get the context (post type, template, etc.)
  2. Query all active field groups
  3. For each group, evaluate location rules
  4. Rules in the same group use AND logic
  5. Different groups use OR logic

Technology Stack

PHP 7.4+WordPress 6.0+React 18TypeScriptZustandTailwind CSSViteshadcn/ui