Advanced Custom Fields

Local JSON: scan_files() reads and decodes every JSON file up to 4 times on every request
On every request, ACF_Local_JSON has four callbacks registered on the acf/include_* actions: * include_fields * include_post_types * include_taxonomies * ACF_UI_Options_Page::include_json_options_pages Each callback calls scan_files( $post_type ). scan_files() walks every load path, then file_get_contents() and json_decode() every .json file, just to read its key and decide whether the file belongs to the type being scanned. After that, each matching file is decoded a second time when it gets registered. So every JSON file is read and decoded four times per request, plus once more for the type it belongs to. This happens even when a type has no JSON at all: we have no post types, taxonomies or options pages in JSON, and those three scans still decode all 145 field-group files. Measured impact (production site, 13 load paths, 145 JSON files, about 1.2 MB): Callback Time include_fields ~34 ms include_post_types ~17 ms include_taxonomies ~17 ms include_json_options_pages ~17 ms Total ~85 ms That's about 85 ms on every request that misses the page cache: logged-in pages, cart, checkout, admin-ajax, and REST. Suggested fixes Scan once per request. Decode each file a single time, group the results by type (the key prefix), and let the four include_* callbacks read from that one result. Cache the scan across requests, with a cache key built from each file's path, mtime, and size, so an edit or a sync invalidates it straight away.
1
·
planned
Feature Request: AI-Friendly Field Creation (Code-Based Input for Faster Setup)
Hello Advanced Custom Fields Team, I’d like to suggest an improvement that could make ACF more compatible with modern AI-assisted workflows. Today, many developers and non-developers are using AI tools to generate HTML layouts and page structures. While this speeds up UI creation, they still need to manually recreate matching ACF fields one by one in the admin panel, which can be time-consuming. 💡 Proposed Feature: “Add Fields via Code” Option It would be extremely helpful to have an option where users can quickly define multiple fields using a simple code-like syntax. For example: country_location:text full_address:text opening_hours:text event_date:datepicker 🔧 How It Could Work Add a button like “Add Fields via Code” or “Bulk Add Fields” in the Fields UI. Users paste a structured list (like above). ACF automatically parses it and creates fields with: Field Label (auto-formatted from name) Field Name Field Type 🚀 Benefits Saves significant time when creating multiple fields Works seamlessly with AI-generated layouts Reduces repetitive manual setup Makes ACF more beginner-friendly for users coming from AI tools Encourages structured, consistent field naming ✨ Optional Enhancements Support more field types (text, textarea, image, select, repeater, etc.) Allow JSON or YAML input formats Provide preview before creating fields Enable export/import of this format for reuse This feature would make ACF even more powerful and aligned with how developers are working today using AI-assisted tools. Thank you for considering this idea! Best regards, [Ravi]
4
·
planned