Title: Antwork Field Code for ACF &amp; SCF
Author: Antwork
Published: <strong>October 31, 2026</strong>
Last modified: November 1, 2026

---

Search plugins

![](https://ps.w.org/antwork-field-code/assets/banner-772x250.png?rev=3776505)

![](https://ps.w.org/antwork-field-code/assets/icon.svg?rev=3776505)

# Antwork Field Code for ACF & SCF

 By [Antwork](https://profiles.wordpress.org/antwork/)

[Download](https://downloads.wordpress.org/plugin/antwork-field-code.1.1.0.zip)

[Live Preview](https://wordpress.org/plugins/antwork-field-code/?preview=1)

 * [Details](https://wordpress.org/plugins/antwork-field-code/#description)
 * [Reviews](https://wordpress.org/plugins/antwork-field-code/#reviews)
 *  [Installation](https://wordpress.org/plugins/antwork-field-code/#installation)
 * [Development](https://wordpress.org/plugins/antwork-field-code/#developers)

 [Support](https://wordpress.org/support/plugin/antwork-field-code/)

## Description

Antwork Field Code is a code generator for Advanced Custom Fields and Secure Custom
Fields. It adds a “Field Code” box under the settings of each field group, with 
the snippets that display the fields of the saved group in a theme template: the
code of each covered field, chosen in the list of fields, coloured by WordPress’s
own code editor, with a Copy button.

The code follows the documentation of Advanced Custom Fields: `get_field()` returns
values that are not escaped, so every value is escaped for where it is printed (`
esc_html()`, `esc_url()`, `esc_attr()`, `wp_kses_post()`, `wp_get_attachment_image()`
for images), and nothing is printed when a field is empty. It follows the WordPress
Coding Standards, runs on PHP 7.4 to 8.4, and names its variables after your fields.

It works with Advanced Custom Fields (free or Pro, version 6) and with Secure Custom
Fields.

#### Features

 * **Code for each covered field**: choose a field in the list, in the order of 
   the field group, to see its code, read only. It reads your field group as it 
   is saved, with the settings that change the code: return format (value, label
   or array; object or ID; URL…), one or several values, appearance of taxonomy 
   fields, new lines of text areas, tabs of icon pickers.
 * **Copy**: a Copy button for each field and “Copy all” for the whole group. Copying
   is announced to screen readers and works with the keyboard.
 * **Field list**: pick a field, or All fields for the whole template; the arrow
   keys move between fields.
 * **Group fields**: the sub-fields of a Group field are read from the group’s value,
   at any depth.
 * **Readable code**: one variable per field, a guard on empty values, comments 
   where a value needs explaining (formatted dates, post objects or IDs).
 * **Help menu**: links to the support forum and to the reviews on WordPress.org,
   and a button that copies your WordPress, PHP, ACF or SCF and plugin versions 
   to the clipboard (shown to users who can see Site Health). Nothing is sent from
   your site.
 * **For developers**: filters let another plugin cover a field type, add a location(
   such as an options page), and add code before or after each snippet.

#### Covered field types

 * Basic: Text, Text Area, Number, Range, Email, URL, Password (read, never printed).
 * Content: Image (Array, URL, ID), File (Array, URL, ID), Wysiwyg Editor, oEmbed.
 * Choice: Select (one or several values; Value, Label or Array), Checkbox, Radio
   Button and Button Group (Value, Label or Array), True / False.
 * Relational: Link (Array or URL), Post Object (one or several; Post Object or 
   Post ID), Page Link (one or several), Relationship (Post Object or Post ID), 
   Taxonomy (Checkbox, Multi Select, Radio Buttons or Select; Term Object or Term
   ID), User (one or several; User Array, User Object or User ID).
 * Advanced: Google Map, Date Picker, Date Time Picker, Time Picker, Color Picker(
   Hex string, RGBA string or RGBA array), Icon Picker (String or Array).
 * Layout: Group, with its sub-fields. Message, Tab, Accordion and Separator hold
   no value and get no code.

Repeater, Flexible Content, Gallery, Clone and field types added by other plugins
show “This field type is not covered yet.”

#### Where the code works

The code reads the fields of the current post, inside the Loop of a template for
posts, pages or custom post types. A field group shown elsewhere (an options page,
a taxonomy, a user, ACF Blocks…) still gets its code, with a line that names the
location that is not covered yet.

#### Antwork Field Code Pro

Antwork Field Code Pro is a separate plugin, sold at [antwork.fr](https://antwork.fr/field-code-pro).
It adds the code of Repeater, Flexible Content, Gallery and Clone fields, and of
field groups shown on options pages, taxonomy terms, users, comments, attachments
and widgets. Where it would apply, the Field Code box says so in one sentence that
you can dismiss.

#### Ideas and bugs

Have an idea for the plugin? Suggest it in the [support forum](https://wordpress.org/support/plugin/antwork-field-code/),
where bugs are reported too.

#### Privacy

Privacy: this plugin makes no external request. It collects no data, adds no tracking
and stores no option in the database, so there is nothing to clean up when you delete
it.

Antwork Field Code is an independent plugin. It is not affiliated with or endorsed
by Advanced Custom Fields or Secure Custom Fields.

If it saves you time, a [review on WordPress.org](https://wordpress.org/support/plugin/antwork-field-code/reviews/#new-post)
helps other developers find it.

### Switching from another code generator

The code appears under the settings of each field group.

 1. Deactivate the other code generator, if any.
 2. Install and activate Antwork Field Code.
 3. Edit a field group: the “Field Code” box shows the code of its fields.

There is nothing to set up and nothing to migrate: the plugin stores no settings.

## Screenshots

[⌊The Field Code box under a field group of Advanced Custom Fields: the fields on
the left, the code of the chosen field on the right, copied in one click.⌉⌊The Field
Code box under a field group of Advanced Custom Fields: the fields on the left, 
the code of the chosen field on the right, copied in one click.⌉[

The Field Code box under a field group of Advanced Custom Fields: the fields on 
the left, the code of the chosen field on the right, copied in one click.

[⌊The same box with Secure Custom Fields: the code of a Group field and its sub-
fields.⌉⌊The same box with Secure Custom Fields: the code of a Group field and its
sub-fields.⌉[

The same box with Secure Custom Fields: the code of a Group field and its sub-fields.

[⌊The help menu: report a bug, suggest an idea, leave a review, or copy your system
info.⌉⌊The help menu: report a bug, suggest an idea, leave a review, or copy your
system info.⌉[

The help menu: report a bug, suggest an idea, leave a review, or copy your system
info.

## Installation

 1. Install and activate Advanced Custom Fields or Secure Custom Fields.
 2. Install Antwork Field Code from the Plugins screen (Plugins > Add New, search for“
    Antwork Field Code”) and activate it.
 3. Edit a field group and save it: the “Field Code” box appears under its settings.
 4. Copy the code of a field, or “Copy all”, and paste it into a template of your theme(
    for example `single.php`), inside the Loop.

## FAQ

### Does it need Advanced Custom Fields?

It needs Advanced Custom Fields (free or Pro, version 6) or Secure Custom Fields.
Without one of them, it only shows a notice on the Plugins screen and does nothing
else.

### Who sees the Field Code box?

The users who may manage field groups: by default, administrators (the capability
set for Advanced Custom Fields or Secure Custom Fields, `manage_options` unless 
changed).

### Why does the box ask me to save the field group?

The code is built from the saved field group, on the server. Save the field group
after adding or changing fields to see their code.

### Is the code safe to paste in my theme?

Yes: every value is escaped for where it is printed, as the documentation of Advanced
Custom Fields recommends. Text goes through `esc_html()`, links through `esc_url()`,
attributes through `esc_attr()`, HTML content (Wysiwyg, Text Area with new lines)
through `wp_kses_post()`, images through `wp_get_attachment_image()`, and the oEmbed
field keeps its iframe only. Field names are written as plain PHP strings, so an
unusual field name cannot break the code.

### Why is my field type not covered?

Repeater, Flexible Content, Gallery and Clone fields are covered by [Antwork Field Code Pro](https://antwork.fr/field-code-pro),
a separate plugin. The field types of other plugins are not covered yet: tell us
which one you need in the support forum.

### Does it change my field groups or my database?

No. It reads the field group and shows code. It writes nothing in the database, 
makes no external request and stores no settings.

### Can another plugin change the code?

Yes. The filters `awfc_field_renderers` (cover or replace a field type), `awfc_locations`(
add a location, such as an options page, with the post ID it passes to `get_field()`),`
awfc_location_post_id` (change that post ID with the whole location rule), `awfc_snippet_header`
and `awfc_snippet_footer` (add code before or after each snippet) are documented
in the plugin’s repository.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Antwork Field Code for ACF & SCF” is open source software. The following people
have contributed to this plugin.

Contributors

 *   [ Antwork ](https://profiles.wordpress.org/antwork/)

[Translate “Antwork Field Code for ACF & SCF” into your language.](https://translate.wordpress.org/projects/wp-plugins/antwork-field-code)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/antwork-field-code/),
check out the [SVN repository](https://plugins.svn.wordpress.org/antwork-field-code/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/antwork-field-code/)
by [RSS](https://plugins.trac.wordpress.org/log/antwork-field-code/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.1.0

 * The sub-fields of a Group field tell other plugins which array they are read 
   from (`container`), and the new filter `awfc_location_post_id` receives the whole
   location rule, such as the options page.
 * A field named `args` is read into `$args_field`, so that it never replaces the`
   $args` of a widget.
 * Under a field type or a location that Antwork Field Code Pro covers, the Field
   Code box says so in one sentence, with a link and a Dismiss button. Dismissing
   is remembered in your browser: nothing is stored on your site and no request 
   is made.

#### 1.0.0

 * First release: the code of 29 field types, with each return format and appearance,
   escaped as the ACF documentation recommends; Copy, Copy all and field list; help
   menu; hooks for field types, locations, headers and footers.

## Meta

 *  Version **1.1.0**
 *  Last updated **5 hours ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.3 or higher **
 *  Tested up to **7.1.4**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [acf](https://wordpress.org/plugins/tags/acf/)[code generator](https://wordpress.org/plugins/tags/code-generator/)
   [php](https://wordpress.org/plugins/tags/php/)[snippets](https://wordpress.org/plugins/tags/snippets/)
   [theme development](https://wordpress.org/plugins/tags/theme-development/)
 *  [Advanced View](https://wordpress.org/plugins/antwork-field-code/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/antwork-field-code/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/antwork-field-code/reviews/)

## Contributors

 *   [ Antwork ](https://profiles.wordpress.org/antwork/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/antwork-field-code/)