22. Field Values API | Field Forge - Custom Fields, Built for Speed
Download Log in

22. Field Values API

Developer Guide

Read and write field values for individual posts via REST.

GET /fieldforge/v1/fields/{post_id}

Get all field values for a post.

bash
curl -s -u "$AUTH" 
  "https://example.com/wp-json/fieldforge/v1/fields/42"
Response:
json
{
  "price": "29.99",
  "subtitle": "Great product",
  "is_featured": "1",
  "sku": "PROD-001",
  "hero": {
    "headline": "Launch headline",
    "cta_url": "https://example.com/start"
  },
  "features": [
    { "title": "Fast setup", "body": "Editors can add this row." },
    { "title": "Reusable", "body": "Developers get structured JSON." }
  ],
  "sections": [
    {
      "acf_fc_layout": "hero",
      "heading": "Flexible hero"
    },
    {
      "acf_fc_layout": "cta",
      "label": "Book a demo",
      "url": "https://example.com/demo"
    }
  ]
}

Compound values are returned in the same shape as the ACF-compatible template API: Group fields are associative objects, Repeaters are arrays of row objects, Flexible Content rows include acf_fc_layout, Gallery values are arrays, and Relationship / Post Object / Taxonomy fields respect each field’s configured return format. The endpoint no longer exposes the internal parent-row scalars used in wp_fieldforge_values for Group, Repeater, and Flexible Content storage.

PUT /fieldforge/v1/fields/{post_id}

Update multiple field values in a single request.

bash
curl -s -X PUT -u "$AUTH" 
  -H "Content-Type: application/json" 
  "https://example.com/wp-json/fieldforge/v1/fields/42" 
  -d '{
    "price": "34.99",
    "is_featured": "1",
    "subtitle": "Updated subtitle"
  }'
Response: { "success": true }

Forge AI Assistant Online

Hi! I'm the Field Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs