Advanced Custom Fields (ACF) Documentation

repository·main·Indexed 23 days ago

https://github.com/pronamic/advanced-custom-fields-pro

A professional WordPress plugin for adding custom data fields to content types. ACF PRO includes advanced features such as Repeater Fields, ACF Blocks, Flexible Content, Options Pages, Gallery Fields, and Clone Fields. The plugin provides a WP-CLI command (`wp acf json`) for managing field groups, post types, and taxonomies via JSON files, supporting synchronization, import, and export workflows.

Tokens
2.5K
Snippets
3
Records
23
Agent score
79%

What's inside Advanced Custom Fields (ACF)

  1. Overview of Advanced Custom Fields (ACF)

    main

    Advanced Custom Fields (ACF) is a tool for customizing WordPress by adding powerful, intuitive custom fields to your content model. It allows you to add structure to WordPress edit screens and display that data anywhere in your theme templates using developer-friendly functions.

    Key Capabilities:

    • Add fields on demand: Quickly add fields to post edit screens via a field builder.
    • Add them anywhere: Attach fields to posts, pages, users, taxonomy terms, media, comments, and custom options pages.
    • Show them everywhere: Use ACF functions to load and display custom field values in any theme template file.
    • Content Modeling: Register custom post types and taxonomies directly within the ACF UI without writing code.
  2. Implement Bidirectional Relationships

    main

    Starting with version 6.2.0, ACF supports Bidirectional Relationships. This feature allows you to automatically update the related field on the connected post/term when a relationship is established. It is supported for the following field types:

    • Relationship
    • Post Object
    • User
    • Taxonomy
  3. Compare ACF vs. ACF PRO features

    main

    While the standard ACF plugin provides core field functionality, ACF PRO includes advanced features for complex content modeling:

    • Repeater Field: Create sets of sub-fields that can be repeated multiple times.
    • ACF Blocks: A PHP-based framework for developing custom blocks for the WordPress Block Editor (Gutenberg).
    • Flexible Content Field: Provides multiple layout and sub-field options for complex content structures.
    • Options Page: Add custom admin pages to manage global ACF fields.
    • Gallery Field: Build customizable image galleries.
    • Clone Field: Reuse existing fields and field groups by cloning them into other groups.
  4. Access ACF documentation and support

    main

    For technical guidance, feature explanations, or troubleshooting, use the following official channels:

    • Documentation: Search the official ACF documentation for guides and feature details.
    • Support Forum: Start a new thread in the support forum for community help.
    • Direct Support: Contact the support team via their email-based ticket system.
    • Feedback: Submit feature suggestions or product feedback to the feedback board.

    Note: Do not use the GitHub issue tracker for support requests; it is reserved for reporting core software issues only.

  5. Install Advanced Custom Fields (ACF) via WordPress Dashboard

    main

    To install the standard version of Advanced Custom Fields, follow these steps within your WordPress admin area:

    1. Navigate to Plugins > Add New.
    2. Search for "Advanced Custom Fields" or "ACF".
    3. Click Install and then Activate on the Advanced Custom Fields plugin.
    4. Once activated, click the new ACF menu item to begin creating field groups, custom post types, or taxonomies.
  6. System Requirements for ACF

    main

    Depending on the version installed, ACF has specific minimum requirements for WordPress and PHP:

    • Current/Recent Versions: Requires WordPress 6.0 or newer and PHP 7.4 or newer.
    • Version 6.2.0 and newer: Requires WordPress 5.8 or newer and PHP 7.0 or newer.
  7. Manage ACF JSON via WP-CLI

    main

    The wp acf json command allows you to manage ACF field groups, post types, taxonomies, and options pages using JSON files via the command line. This is useful for synchronizing local JSON changes to the database, importing/exporting configurations, and automating deployment workflows.

    Available Sub-commands

    • status: View the synchronization status between local JSON files and the database.
    • sync: Import pending local JSON changes into the database.
    • import: Import ACF items from a specific .json file.
    • export: Export ACF items to a JSON file or stdout.
    # Show sync status
    wp acf json status
    
    # Sync changes
    wp acf json sync
    
    # Import a file
    wp acf json import ./acf-export.json
    
    # Export to a directory
    wp acf json export --dir=./exports/