ACF Sync
import { Aside } from ‘@astrojs/starlight/components’;
The Loopress plugin exposes a REST API that the Loopress CLI uses to pull and push ACF field group definitions. The admin UI does not surface ACF features directly; use the CLI.
Requirements
Section titled “Requirements”- Advanced Custom Fields (free or Pro) installed and active
- Loopress plugin installed and active
- Administrator role (
manage_optionscapability)
REST API
Section titled “REST API”GET /wp-json/lps/v1/acf/field-groups
Section titled “GET /wp-json/lps/v1/acf/field-groups”Returns all ACF field groups with their nested fields.
Response:
[ { "key": "group_64abc123", "title": "Product Details", "fields": [ { "key": "field_64abc124", "label": "Price", "name": "price", "type": "number" } ], "location": [...] }]POST /wp-json/lps/v1/acf/field-groups
Section titled “POST /wp-json/lps/v1/acf/field-groups”Import a field group. The request body must be a valid ACF field group object with a key property. Equivalent to ACF’s own Tools → Import feature.
Request body:
{ "key": "group_64abc123", "title": "Product Details", "fields": [...], "location": [...]}Response: The imported field group object as returned by ACF.
CLI usage
Section titled “CLI usage”→ See ACF Field Groups (CLI) for the lps acf pull and lps acf push commands.
Error responses
Section titled “Error responses”| Status | Cause |
|---|---|
400 | ACF plugin is not active |
400 | Missing key in POST body |
403 | Caller does not have manage_options capability |