bricks_get_acf_field_groups

Phase 1BeginnerRead OnlyComplexity: 2/10
List all ACF and Meta Box field groups with fields

Overview

Retrieves all ACF (Advanced Custom Fields) field values for a specific post or page. Returns all custom field values associated with the post, organized by their field groups.

This is the read companion to bricks_set_acf_values. Use it to inspect what custom field data is stored on a post before updating, or to verify that field values were set correctly after creation.

Essential for debugging ACF-powered dynamic content in Bricks templates, especially when using dynamic data tags like {acf_field_name}.

Key Features

Organized by Field Group
Returns values grouped under their respective ACF field groups, making it easy to identify which group each field belongs to.
All Field Types Supported
Retrieves values for every ACF field type: text, image, gallery, repeater, relationship, taxonomy, group, true_false, and more. Complex fields return their full structured data.
Any Post Type
Works with any post type — pages, posts, custom post types. Simply provide the post ID.

When to Use

You need to inspect ACF field values on a post or page
You want to verify that bricks_set_acf_values wrote data correctly
You are debugging dynamic data tags that reference ACF fields
You need to read custom field data before building a Bricks template
You want to audit what metadata is stored on a custom post type
Prerequisites
ACF Pro plugin must be installed and activated
At least one ACF field group must exist
The target post/page must exist and have ACF fields assigned to its post type

When NOT to Use

You want to list field group definitions (schemas) rather than values — check ACF admin panel
You need Meta Box field values — use bricks_get_mb_values instead
You want to read standard WordPress post meta — use WordPress REST API

Parameters

1 Total Parameters1 Required

Warning: Undefined array key "param_enum_values" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 28
post_idnumberREQUIRED
The WordPress post/page ID to retrieve ACF field values from.

Code Examples


Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12

Get ACF fields for a page

Retrieves all ACF field values stored on page ID 42.

JSON
bricks_get_acf_fields({
  post_id: 42
})
// Returns:
// {
//   "Hero Settings": {
//     "hero_title": "Welcome to Our Site",
//     "hero_background": { "url": "https://...", "id": 123 },
//     "hero_cta_text": "Get Started"
//   },
//   "SEO Settings": {
//     "seo_keywords": "bricks, builder, mcp"
//   }
// }

Common Mistakes


Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1935

Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48

Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Passing a post ID that does not exist or does not have ACF fields assigned to its post type will return empty results. Verify the post exists and that ACF field groups target its post type.

Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1935

Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48

Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
ACF internally uses field keys (field_abc123) but this tool returns values indexed by field names (hero_title). When using bricks_set_acf_values, use the field name, not the internal key.

Tips & Warnings

Tips & Warnings

Tip: Use this tool before building Bricks templates with dynamic data to understand what ACF fields are available and what data is stored.

Tip: For repeater fields, the returned value is an array of rows, each containing sub-field key-value pairs. For relationship fields, the value is an array of related post IDs or objects depending on the return_format setting.

Warning: Requires ACF Pro to be active. Standard WordPress custom fields (post meta) that were not created through ACF may not appear in the grouped output.

Return Values

FieldTypeDescription
field_groupsobjectACF field values organized by field group, with field names as keys and their stored values.
post_idnumberThe post ID that was queried.

Related Tools

Technical Details

Tool ID
bricks_get_acf_field_groups
API Endpoint
/acf/values/197
HTTP Method
GET
Namespace
acf
Source File
acf/field-groups.ts
Version
1.0
Min Bricks Version
1.9
Requires Plugin
ACF Pro
Requires Auth
Yes

Changelog

v1.0
Initial release with support for reading all ACF field types organized by field group.
20250101