{"id":15628339,"url":"https://github.com/log1x/acf-builder-cheatsheet","last_synced_at":"2025-04-07T10:28:06.214Z","repository":{"id":41975022,"uuid":"145541184","full_name":"Log1x/acf-builder-cheatsheet","owner":"Log1x","description":"A cheatsheet for use with ACF Builder.","archived":false,"fork":false,"pushed_at":"2023-10-10T02:15:26.000Z","size":61,"stargazers_count":321,"open_issues_count":4,"forks_count":39,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-29T17:44:37.032Z","etag":null,"topics":["acf","acf-builder","acf-field","advanced-custom-fields","cheatsheet"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Log1x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"Log1x"}},"created_at":"2018-08-21T09:31:54.000Z","updated_at":"2025-03-02T11:35:13.000Z","dependencies_parsed_at":"2024-01-17T04:41:08.442Z","dependency_job_id":"31d982d8-3597-42ba-8be6-4fa0c6ec0d14","html_url":"https://github.com/Log1x/acf-builder-cheatsheet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Log1x%2Facf-builder-cheatsheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Log1x%2Facf-builder-cheatsheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Log1x%2Facf-builder-cheatsheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Log1x%2Facf-builder-cheatsheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Log1x","download_url":"https://codeload.github.com/Log1x/acf-builder-cheatsheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247634840,"owners_count":20970613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acf","acf-builder","acf-field","advanced-custom-fields","cheatsheet"],"created_at":"2024-10-03T10:22:00.432Z","updated_at":"2025-04-07T10:28:06.186Z","avatar_url":"https://github.com/Log1x.png","language":null,"funding_links":["https://github.com/sponsors/Log1x"],"categories":[],"sub_categories":[],"readme":"# ACF Builder Cheatsheet\n\nThis cheatsheet consists of ACF Field Type arguments for use with [ACF Builder](https://github.com/StoutLogic/acf-builder/) as well as the known (most of which are not documented) configuration methods to assist in building fields. While the below field types reveal all of the possible configuration passable in the field type config array, most have available chainable methods to assist in building out cleaner, more readable code.\n\nIf you are new to ACF Builder and would like to learn more, you can read my guide [here](https://roots.io/guides/using-acf-builder-with-sage/).\n\n## Table of Contents\n\n| [Basic](#basic)       | [Content](#content) | [Choice](#choice)            | [Relational](#relational)     | [jQuery](#jquery)                     | [Layout](#layout)                     | [Configuration](#configuration)   |\n|:----------------------|:--------------------|:-----------------------------|:------------------------------|:--------------------------------------|:--------------------------------------|:----------------------------------|\n| [Text](#text)         | [Wysiwyg](#wysiwyg) | [Select](#select)            | [Link](#link)                 | [Google Map](#google-map)             | [Message](#message)                   | [Composing](#composing-fields)    |\n| [Textarea](#textarea) | [Oembed](#oembed)   | [Checkbox](#checkbox)        | [Post Object](#post-object)   | [Date Picker](#date-picker)           | [Accordion](#accordion)               | [Modifying](#modifying-fields)    |\n| [Number](#number)     | [Image](#image)     | [Radio](#radio)              | [Page Link](#page-link)       | [Date Time Picker](#date-time-picker) | [Tab](#tab)                           | [Removing](#removing-fields)      |\n| [Range](#range)       | [File](#file)       | [True / False](#true--false) | [Relationship](#relationship) | [Time Picker](#time-picker)           | [Group](#group)                       | [Choices](#field-choices)         |\n| [Email](#email)       | [Gallery](#gallery) |                              | [Taxonomy](#taxonomy)         | [Color Picker](#color-picker)         | [Repeater](#repeater)                 | [Conditions](#field-conditions)   |\n| [URL](#url)           |                     |                              | [User](#user)                 |                                       | [Flexible Content](#flexible-content) | [Wrapper](#field-wrapper)         |\n| [Password](#password) |                     |                              |                               |                                       |                                       | [Location](#field-group-location) |\n| [Custom / 3rd Party](#composing-custom3rd-party-addon-fields) |    |       |                               |                                       |                                       | [Position](#field-group-position) |\n\n## Field Types\n\nYou can find a full reference of available settings on the [official ACF documentation](https://www.advancedcustomfields.com/resources/register-fields-via-php/#field-type%20settings).\n\n### Basic\n\n#### Text\n```php\n$builder\n    -\u003eaddText('text_field', [\n        'label' =\u003e 'Text Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'default_value' =\u003e '',\n        'placeholder' =\u003e '',\n        'prepend' =\u003e '',\n        'append' =\u003e '',\n        'maxlength' =\u003e '',\n  ]);\n```\n[Official Documentation]( https://www.advancedcustomfields.com/resources/text)\n\n#### Textarea\n```php\n$builder\n  -\u003eaddTextarea('textarea_field', [\n      'label' =\u003e 'Textarea Field',\n      'instructions' =\u003e '',\n      'required' =\u003e 0,\n      'wrapper' =\u003e [\n          'width' =\u003e '',\n          'class' =\u003e '',\n          'id' =\u003e '',\n      ],\n      'default_value' =\u003e '',\n      'placeholder' =\u003e '',\n      'maxlength' =\u003e '',\n      'rows' =\u003e '',\n      'new_lines' =\u003e '', // Possible values are 'wpautop', 'br', or ''.\n  ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/textarea)\n\n#### Number\n```php\n$builder\n    -\u003eaddNumber('number_Field', [\n        'label' =\u003e 'Number Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'default_value' =\u003e '',\n        'placeholder' =\u003e '',\n        'prepend' =\u003e '',\n        'append' =\u003e '',\n        'min' =\u003e '',\n        'max' =\u003e '',\n        'step' =\u003e '',\n  ]);\n```\n\n#### Range\n```php\n$builder\n    -\u003eaddRange('range_field', [\n        'label' =\u003e 'Range Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n          'width' =\u003e '',\n          'class' =\u003e '',\n          'id' =\u003e '',\n        ],\n        'default_value' =\u003e '',\n        'min' =\u003e '',\n        'max' =\u003e '',\n        'step' =\u003e '',\n        'prepend' =\u003e '',\n        'append' =\u003e '',\n    ]);\n```\n\n#### Email\n```php\n$builder\n    -\u003eaddEmail('email_field', [\n        'label' =\u003e 'Email Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'default_value' =\u003e '',\n        'placeholder' =\u003e '',\n        'prepend' =\u003e '',\n        'append' =\u003e '',\n    ]);\n```\n\n#### URL\n```php\n$builder\n    -\u003eaddUrl('url_field', [\n        'label' =\u003e 'URL Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'default_value' =\u003e '',\n        'placeholder' =\u003e '',\n    ]);\n```\n\n#### Password\n```php\n$builder\n    -\u003eaddPassword('password_field', [\n        'label' =\u003e 'Password Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'placeholder' =\u003e '',\n        'prepend' =\u003e '',\n        'append' =\u003e '',\n    ]);\n```\n\n### Content\n\n#### Wysiwyg\n```php\n$builder\n    -\u003eaddWysiwyg('wysiwyg_field', [\n        'label' =\u003e 'WYSIWYG Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'default_value' =\u003e '',\n        'tabs' =\u003e 'all',\n        'toolbar' =\u003e 'full',\n        'media_upload' =\u003e 1,\n        'delay' =\u003e 0,\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/wysiwyg)\n\n#### Oembed\n```php\n$builder\n    -\u003eaddOembed('oembed_field', [\n        'label' =\u003e 'Oembed Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'width' =\u003e '',\n        'height' =\u003e '',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/oembed)\n\n#### Image\n```php\n$builder\n    -\u003eaddImage('image_field', [\n        'label' =\u003e 'Image Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'return_format' =\u003e 'array',\n        'preview_size' =\u003e 'thumbnail',\n        'library' =\u003e 'all',\n        'min_width' =\u003e '',\n        'min_height' =\u003e '',\n        'min_size' =\u003e '',\n        'max_width' =\u003e '',\n        'max_height' =\u003e '',\n        'max_size' =\u003e '',\n        'mime_types' =\u003e '',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/image)\n\n#### File\n```php\n$builder\n    -\u003eaddFile('file_Field', [\n        'label' =\u003e 'File Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'return_format' =\u003e 'array',\n        'library' =\u003e 'all',\n        'min_size' =\u003e '',\n        'max_size' =\u003e '',\n        'mime_types' =\u003e '',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/file)\n\n#### Gallery\n```php\n$builder\n    -\u003eaddGallery('gallery_field', [\n        'label' =\u003e 'Gallery Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'return_format' =\u003e 'array',\n        'min' =\u003e '',\n        'max' =\u003e '',\n        'insert' =\u003e 'append',\n        'library' =\u003e 'all',\n        'min_width' =\u003e '',\n        'min_height' =\u003e '',\n        'min_size' =\u003e '',\n        'max_width' =\u003e '',\n        'max_height' =\u003e '',\n        'max_size' =\u003e '',\n        'mime_types' =\u003e '',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/gallery)\n\n### Choice\n\n#### Select\n```php\n$builder\n    -\u003eaddSelect('select_field', [\n        'label' =\u003e 'Select Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'choices' =\u003e [],\n        'default_value' =\u003e [],\n        'allow_null' =\u003e 0,\n        'multiple' =\u003e 0,\n        'ui' =\u003e 0,\n        'ajax' =\u003e 0,\n        'return_format' =\u003e 'value',\n        'placeholder' =\u003e '',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/select)\n\n#### Checkbox\n```php\n$builder\n    -\u003eaddCheckbox('checkbox_field', [\n        'label' =\u003e 'Checkbox Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'choices' =\u003e [],\n        'allow_custom' =\u003e 0,\n        'save_custom' =\u003e 0,\n        'default_value' =\u003e [],\n        'layout' =\u003e 'vertical',\n        'toggle' =\u003e 0,\n        'return_format' =\u003e 'value',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/checkbox)\n\n#### Radio\n```php\n$builder\n    -\u003eaddRadio('radio_field', [\n        'label' =\u003e 'Radio Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'choices' =\u003e [],\n        'allow_null' =\u003e 0,\n        'other_choice' =\u003e 0,\n        'save_other_choice' =\u003e 0,\n        'default_value' =\u003e '',\n        'layout' =\u003e 'vertical',\n        'return_format' =\u003e 'value',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/radio-button)\n\n#### Button Group\n```php\n$builder\n    -\u003eaddButtonGroup('button_group_field', [\n        'label' =\u003e 'Button Group Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n          'width' =\u003e '',\n          'class' =\u003e '',\n          'id' =\u003e '',\n        ],\n        'choices' =\u003e [],\n        'allow_null' =\u003e 0,\n        'default_value' =\u003e '',\n        'layout' =\u003e 'horizontal',\n        'return_format' =\u003e 'value',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/button-group/)\n\n#### True / False\n```php\n$builder\n    -\u003eaddTrueFalse('truefalse_field', [\n        'label' =\u003e 'True / False Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'message' =\u003e '',\n        'default_value' =\u003e 0,\n        'ui' =\u003e 0,\n        'ui_on_text' =\u003e '',\n        'ui_off_text' =\u003e '',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/true-false)\n\n### Relational\n\n#### Link\n```php\n$builder\n    -\u003eaddLink('link_field', [\n        'label' =\u003e 'Link Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'return_format' =\u003e 'array',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/link)\n\n#### Post Object\n```php\n$builder\n    -\u003eaddPostObject('post_object_field', [\n        'label' =\u003e 'Post Object Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'post_type' =\u003e [],\n        'taxonomy' =\u003e [],\n        'allow_null' =\u003e 0,\n        'multiple' =\u003e 0,\n        'return_format' =\u003e 'object',\n        'ui' =\u003e 1,\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/post-object/)\n\n#### Page Link\n```php\n$builder\n    -\u003eaddPageLink('page_link_field', [\n        'label' =\u003e 'Page Link Field',\n        'type' =\u003e 'page_link',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'post_type' =\u003e [],\n        'taxonomy' =\u003e [],\n        'allow_null' =\u003e 0,\n        'allow_archives' =\u003e 1,\n        'multiple' =\u003e 0,\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/page-link)\n\n#### Relationship\n```php\n$builder\n    -\u003eaddRelationship('relationship_field', [\n        'label' =\u003e 'Relationship Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'post_type' =\u003e [],\n        'taxonomy' =\u003e [],\n        'filters' =\u003e [\n            0 =\u003e 'search',\n            1 =\u003e 'post_type',\n            2 =\u003e 'taxonomy',\n        ],\n        'elements' =\u003e '',\n        'min' =\u003e '',\n        'max' =\u003e '',\n        'return_format' =\u003e 'object',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/relationship)\n\n#### Taxonomy\n```php\n$builder\n    -\u003eaddTaxonomy('taxonomy_field', [\n        'label' =\u003e 'Taxonomy Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'taxonomy' =\u003e 'category',\n        'field_type' =\u003e 'checkbox',\n        'allow_null' =\u003e 0,\n        'add_term' =\u003e 1,\n        'save_terms' =\u003e 0,\n        'load_terms' =\u003e 0,\n        'return_format' =\u003e 'id',\n        'multiple' =\u003e 0,\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/taxonomy)\n\n#### User\n```php\n$builder\n    -\u003eaddUser('user_field', [\n        'label' =\u003e 'User Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'role' =\u003e '',\n        'allow_null' =\u003e 0,\n        'multiple' =\u003e 0,\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/user/)\n\n### jQuery\n\n#### Google Map\n```php\n$builder\n    -\u003eaddGoogleMap('google_map_field', [\n        'label' =\u003e 'Google Map Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'center_lat' =\u003e '',\n        'center_lng' =\u003e '',\n        'zoom' =\u003e '',\n        'height' =\u003e '',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/google-map)\n\n#### Date Picker\n```php\n$builder\n    -\u003eaddDatePicker('date_picker_field', [\n        'label' =\u003e 'Date Picker Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'display_format' =\u003e 'd/m/Y',\n        'return_format' =\u003e 'd/m/Y',\n        'first_day' =\u003e 1,\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/date-picker)\n\n#### Date Time Picker\n```php\n$builder\n    -\u003eaddDateTimePicker('date_time_picker_field', [\n        'label' =\u003e 'Date Time Picker Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/date-time-picker)\n\n#### Time Picker\n```php\n$builder\n    -\u003eaddTimePicker('time_picker_field', [\n        'label' =\u003e 'Time Picker Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'display_format' =\u003e 'g:i a',\n        'return_format' =\u003e 'g:i a',\n        'default_value' =\u003e '',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/time-picker)\n\n#### Color Picker\n```php\n$builder\n    -\u003eaddColorPicker('color_picker_field', [\n        'label' =\u003e 'Color Picker Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'enable_opacity' =\u003e 0,\n        'return_format' =\u003e 'string',\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'default_value' =\u003e '',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/color-picker/)\n\n### Layout\n\n#### Message\n```php\n$builder\n    -\u003eaddMessage('message_field', 'message', [\n        'label' =\u003e 'Message Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n            'width' =\u003e '',\n            'class' =\u003e '',\n            'id' =\u003e '',\n        ],\n        'message' =\u003e '',\n        'new_lines' =\u003e 'wpautop', // 'wpautop', 'br', '' no formatting\n        'esc_html' =\u003e 0,\n    ]);\n```\n\n#### Accordion\n```php\n$builder\n    -\u003eaddAccordion('accordion_field', [\n        'label' =\u003e 'Accordion Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n          'width' =\u003e '',\n          'class' =\u003e '',\n          'id' =\u003e '',\n        ],\n        'open' =\u003e 0,\n        'multi_expand' =\u003e 0,\n        'endpoint' =\u003e 0,\n    ]);\n\n$builder\n    -\u003eaddAccordion('accordion_field_end')-\u003eendpoint();\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/accordion/)\n\n#### Tab\n```php\n$builder\n    -\u003eaddTab('tab_field', [\n        'label' =\u003e 'Tab Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n          'width' =\u003e '',\n          'class' =\u003e '',\n          'id' =\u003e '',\n        ],\n        'default_value' =\u003e '',\n        'placeholder' =\u003e '',\n        'prepend' =\u003e '',\n        'append' =\u003e '',\n        'maxlength' =\u003e '',\n        'placement' =\u003e '',\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/tab/)\n\n#### Group\n```php\n$builder\n    -\u003eaddGroup('group_field', [\n        'label' =\u003e 'Group Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n          'width' =\u003e '',\n          'class' =\u003e '',\n          'id' =\u003e '',\n        ],\n        'layout' =\u003e 'block'\n    ])\n        -\u003eaddText('sub_field')\n    -\u003eendGroup();\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/group/)\n\n#### Repeater\n```php\n$builder\n    -\u003eaddRepeater('repeater_field', [\n        'label' =\u003e 'Repeater Field',\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n          'width' =\u003e '',\n          'class' =\u003e '',\n          'id' =\u003e '',\n        ],\n        'collapsed' =\u003e '',\n        'min' =\u003e 0,\n        'max' =\u003e 0,\n        'layout' =\u003e 'table',\n        'button_label' =\u003e '',\n        'sub_fields' =\u003e [],\n    ]);\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/repeater/)\n\n#### Flexible Content\n```php\n$builder\n    -\u003eaddFlexibleContent('flexible_content_field', [\n        'instructions' =\u003e '',\n        'required' =\u003e 0,\n        'conditional_logic' =\u003e [],\n        'wrapper' =\u003e [\n          'width' =\u003e '',\n          'class' =\u003e '',\n          'id' =\u003e '',\n        ],\n        'button_label' =\u003e 'Add Row',\n        'min' =\u003e '',\n        'max' =\u003e '',\n    ]);\n\n$builder\n    -\u003eaddLayout('layout', [\n        'label' =\u003e 'Layout',\n        'display' =\u003e 'block',\n        'sub_fields' =\u003e [],\n        'min' =\u003e '',\n        'max' =\u003e '',\n    ]);\n\n$builder\n    -\u003eaddLayout(new FieldsBuilder());\n```\n[Official Documentation](https://www.advancedcustomfields.com/resources/flexible-content/)\n\n## Configuration\n\n### Composing Fields\n```php\n$builder\n    -\u003eaddFields(new FieldsBuilder());\n\n$builder\n    -\u003eaddField('text', 'title')\n        -\u003esetKey('field_title')\n        -\u003esetLabel('My Label')\n        -\u003esetDefaultValue('Lorem ipsum')\n        -\u003esetInstructions('This is a title.')\n        -\u003esetRequired()\n            -\u003esetUnrequired()\n        -\u003esetConfig('placeholder', 'Enter the title');\n  ```\n\n### Composing Custom/3rd Party Addon Fields\n\nAdd any other registered custom/[3rd party ACF Fields](https://www.advancedcustomfields.com/add-ons/) using the `addField($name, $type, $args)` method.\n\n```php\n$builder\n    -\u003eaddFields(new FieldsBuilder());\n\n$builder\n    -\u003eaddField('icon', 'font-awesome')\n        -\u003esetLabel('My Icon')\n        -\u003esetInstructions('Select an icon')\n        -\u003esetConfig('save_format', 'class')\n```\n\n### Modifying Fields\n```php\n$builder\n    -\u003emodifyField('title', ['label' =\u003e 'Modified Title']);\n\n$builder\n    -\u003eaddFields(new FieldsBuilder())\n        -\u003egetField('title')\n            -\u003emodifyField('title', ['label' =\u003e 'Modified Title']);\n```\n\n### Removing Fields\n```php\n$builder\n    -\u003eremoveField('title');\n```\n\n### Field Choices\n```php\n$builder\n    -\u003eaddChoice('red')\n    -\u003eaddChoice('blue')\n    -\u003eaddChoice('green');\n\n$builder\n    -\u003eaddChoices(['red' =\u003e 'Red'], ['blue' =\u003e 'Blue'], ['green' =\u003e 'Green']);\n```\n\n### Field Conditions\n```php\n$builder\n    -\u003econditional('true_false', '==', '0')\n        -\u003eand('true_false', '!=', '1')\n        -\u003eor('false_true', '==', '1');\n```\n\n### Field Wrapper\n```php\n$builder\n    -\u003esetWidth('30');\n\n$builder\n    -\u003esetSelector('.field')\n    -\u003esetSelector('#field');\n\n$builder\n    -\u003esetAttr('width', '30')\n    -\u003esetAttr('class', 'field')\n    -\u003esetAttr('id', 'field');\n\n$builder\n    -\u003esetWrapper(['width' =\u003e '30', 'class' =\u003e 'field', 'id' =\u003e 'field']);\n```\n\n### Field Group Location\n\n```php\n$builder\n    -\u003esetLocation('post_type', '==', 'page')\n        -\u003eand('page_type', '==', 'front_page');\n```\n\n#### Field Group Locations\n\n* **Post**: `post_type`, `post_type_list`, `post_type_archive`, `post_template`, `post_status`, `post_format`, `post_category`, `post_taxonomy`, `post`\n* **Page**: `page_template`, `page_type`, `page_parent`, `page`\n* **User**: `current_user`, `current_user_role`, `user_form`, `user_role`\n* **Forms**: `taxonomy`, `taxonomy_list`, `attachment`, `comment`, `widget`, `nav_menu`, `nav_menu_item`, `block`, `options_page`\n* **Custom**: [Official Documentation](https://www.advancedcustomfields.com/resources/custom-location-rules/)\n\n### Field Group Position\n```php\n$builder = new FieldsBuilder('banner', ['position' =\u003e 'side']); // acf_after_title, normal, side\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flog1x%2Facf-builder-cheatsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flog1x%2Facf-builder-cheatsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flog1x%2Facf-builder-cheatsheet/lists"}