Este plugin no se ha probado con las últimas 3 versiones mayores de WordPress. Puede que ya no tenga soporte ni lo mantenga nadie, o puede que tenga problemas de compatibilidad cuando se usa con las versiones más recientes de WordPress.

ACF Theme Code for Advanced Custom Fields

Descripción

The ACF Theme Code plugin automatically generates the code needed to implement Advanced Custom Fields in your themes.

Video note: This free version of ACF Theme Code now supports ACF 6.

Funcionalidades

Reduce your development time.

  • When you publish, edit or update an ACF Field Group, the code required to implement your fields is displayed in the Theme Code section at the bottom of your Edit Field Group page.
  • Use the clipboard icons in this section quickly copy and paste the code blocks into your theme templates.

Quality, flexible, custom code.

Comprehensive field support

  • This version of ACF Theme Code generates code for all the field types included in the free version of Advanced Custom Fields (see the full list of field types and settings below).
  • The code generated is specific to the field names and field settings you use for each of your fields.

ACF Theme Code PRO

ACF Theme Code PRO is the premium version of this plugin. It has the following additional features.

  • Support for all the complex field types that are included in Advanced Custom Fields PRO.
    • Repeater
    • Flexible Content
    • Gallery
    • Clone
  • The addition of a Theme Code Location Registration Tool to the ACF Tools page that generates code for registering locations.
    • Blocks
    • Options Pages
  • Support for more complex ACF Field Group Locations.
    • Block
    • Options Page
    • Widget
    • Taxonomy
    • Comment
    • Attachment
    • Current User
    • User Form
  • Support for a range of third party fields.

Upgrade or learn more about ACF Theme Code PRO.

ACF fields supported

This free version of ACF Theme Code generates code for the following ACF field types and settings:

  • Texto
  • Área de texto
  • Número
  • Range
  • Correo electrónico
  • URL
  • Contraseña
  • Image (return types Array, URL and ID)
  • File (return types Array, URL and ID)
  • WYSIWYG Editor
  • oEmbed
  • Select (values Single and Multiple, return types Value, Label and Array)
  • Checkbox (return types Value, Label and Array)
  • Radio Button (return types Value, Label and Array)
  • Button Group (return types Value, Label and Array)
  • Verdadero / Falso
  • Link (return types Array and URL)
  • Post Object (values Single and Multiple, return types Post Object and Post ID)
  • Page Link (values Single and Multiple)
  • Relationship (return types Post Object and Post ID)
  • Taxonomy (appearances Checkbox, Multi Select, Radio Buttons and Select, return types Term Object and Term ID)
  • User (values Single and Multiple, return types User Array, User Object and User ID)
  • Google Map
  • Selector de fecha
  • Date Time Picker
  • Selector de color
  • Group

Requirements

  • Advanced Custom Fields or ACF PRO (version 5.8.9 or higher)

Gracias

¡Gracias a todos nuestros «beta testers», incluidos Elliot Condon, Phil Smart, Richard Johnston y James Bundey.

Translations

Would you like to use the ACF Theme Code plugin in your native language? Then why not contribute a translation via translate.wordpress.org.

If you are new to translating plugins, there is a helpful First Steps guide available.

View the current state translations for ACF Theme Code.

Any and all assistance with translations is greatly appreciated. Please let us know if you need any help with submitting translations.

Capturas

  • El código necesario para implementar cada campo se muestra en la sección «Código del tema».

Instalación

From your WordPress dashboard

  1. Visita Plugins > Añadir nuevo.
  2. Busca “ACF Theme Code”.
  3. Activate ACF Theme Code for Advanced Custom Fields from your Plugins page.
  4. Publish, Edit or Update an ACF Field Group.
  5. Scroll down the Edit Field Group page to the Theme Code section to see the code generated.

Preguntas frecuentes

¿Este plugin es compatible con ACF Pro?

This free version of ACF Theme Code supports all the field types from ACF PRO that are also found in the free version of Advanced Custom Fields.

The ACF Theme Code PRO plugin also supports extra fields found only in ACF PRO. These include the Repeater, Flexible Content, Gallery and Clone fields. It also supports ACF PRO features ACF Blocks and Options Pages.

Does this plugin generate the code needed for different field group Locations?

This free version of ACF Theme Code supports all the Post and Page field group Locations.

The ACF Theme Code PRO plugin also supports a bunch of other field group Locations. These include Block, Options Page, Widget, Taxonomy, Comment, Attachment, Current User and User Form.

Reseñas

15 de noviembre de 2021 1 respuesta
Yes, there’s the awesome code for each custom field, but where this really shines for me is the ease at creating the code to register my custom ACF blocks! I recommend this plugin to other developers constantly! It makes my workflow more efficient and delightful!
9 de noviembre de 2021 1 respuesta
If you’re using Advanced Custom Fields (ACF), then you gotta get this plugin! It’s such a HUGE time saver. When you create your ACF fields, this plugin will automatically generate the PHP code you’ll need, to use those fields in your theme/plugin. No more Googling to search for the correct function to implement your ACF fields. This plugin will save you so much time! Great work guys! 👍👍
8 de noviembre de 2021 1 respuesta
Si eres desarrollador y usas ACF este plugin es perfecto porque tienes todo el PHP necesario con simplemente hacer copia pega. Aunque para campos de texto y otros quizás no sea necesario porque las funciones de ACF son sencillas de recordar, cuando construyes estructuras más complejas con campos de repetición, por ejemplo, te ahorra mucho tiempo. Lo copias, lo pegas en tu función de tu tema o plugin y ya puedes mostrar los datos en pantalla.
Leer todas las 42 reseñas

Colaboradores y desarrolladores

Este software es de código abierto. Las siguientes personas han contribuido a este plugin.

Colaboradores

“ACF Theme Code for Advanced Custom Fields” ha sido traducido a 8 idiomas locales. Gracias a los traductores por sus contribuciones.

Traduce “ACF Theme Code for Advanced Custom Fields” a tu idioma.

¿Interesado en el desarrollo?

Revisa el código, echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.

Registro de cambios

2.5.6

  • Compatibility with WordPress 6.4

2.5.5

  • Add new stylesheet to integrate all components with ACF 6
  • Update scroll to code functionality to support ACF 6

2.5.4

  • Add support for ACF 6

2.5.3

  • Add full support for localization (i18n)
    • Please let us know if you’re interested in helping translate ACF Theme Code into your language.

2.5.2

  • Compatibility with WordPress 5.8.0
  • Fix CSS and JS enqueue bugs

2.5.0

  • Se mejoró la compatibilidad para WordPress 5.4.
  • Improve support for all field types included in ACF PRO 5.8.9 (including all their various settings).
  • Improve codebase by syncing both free and pro foundations to facilitate faster development cycles and future features.
  • Add escaping to code rendered to bring it in line with recent updates to ACF field documentation. See https://twitter.com/wp_acf/status/1181344882775875584.
  • Add ‘Copy All’ fields button (previously only Theme Code Pro feature).
  • Add various enhancements to code rendered for the following fields and field settings:
    • Gallery field (return types Array, URL and ID)
    • Image (return types Array, URL and ID)
    • File (return types Array, URL and ID)
    • Select (values Single and Multiple, return types Value, Label and Array)
    • Checkbox (return types Value, Label and Array)
    • Radio Button (return type Array)
    • Button Group (return type Array)
    • Verdadero / Falso
    • Link (return types Array and URL)
    • Post Object (values Single and Multiple, return types Post Object and Post ID)
    • Page Link (values Single and Multiple)
    • Relationship (return types Post Object and Post ID)
    • Taxonomy (appearances Checkbox, Multi Select, Radio Buttons and Select, return types Term Object and Term ID)
    • User (values Single and Multiple, return types User Array, User Object and User ID)
    • Google Map
  • Add Location UI and move location related upgrade notice to code block
  • Fix issue with location related upgrade notice where it wouldn’t show if only Options location was selected.

1.4.1

  • Compatibilidad con WordPress 5.2.2

1.4.0

  • Funciona con todos los campos gratuitos ACF v5 incluyendo: Grupo, Botón, Rango y campos de enlaces.
  • Corrección: Error con la sección de ubicaciones en PHP 7.2

1.3.2

  • Corrección: Se actualizó clipboard.js & se corrigió un error para la funcionalidad de copiar al portapapeles.

1.3.1

  • Corrección: actualizaciones a la funcionalidad de cuenta de vector para PHP 5.4

1.3.0

  • Núcleo: soporte para ACF Pro cuando viene incluido en un tema
  • Corrección: El output de HTML en el campo de archivo ahora es válida.
  • Núcleo: Aviso de soporte de regla de ubicación (ahora en el código pro del tema ACF)

1.2.0

  • Núcleo: Funcionalidad de enlaces rápidos con enlaces ancla al bloque de código relevante en el tema.
  • Núcleo: Aviso de actualizaciones & varias correcciones de errores.

1.1.2

  • Corrección: Usa el método de campo secundario para los campos de archivo anidados con formato de URL de retorno.

1.1.1

  • Campos: El campo de objeto en las entradas ahora funciona correctamente para ACF 4
  • Núcleo: Varias mejoras internas de código

1.1.0

  • Campos: el formato de todos los campos ha sido mejorado en línea con ACF Theme Code Pro

1.0.0

  • Núcleo: Primera versión