bricks_get_acf_field_groups
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
When to Use
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
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 need Meta Box field values — use bricks_get_mb_values instead
You want to read standard WordPress post meta — use WordPress REST API
Parameters
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_idnumberREQUIREDCode 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.
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
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
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.