fbpx
Awesome

ACF Snippets

Handy snippets to help you use Advanced Custom Fields in your WordPress projects!

Convert an ACF Field Group from PHP to ACF-JSON

I was working on a legacy project recently that had a multiple Advanced Custom Fields – field groups registered with PHP. It was difficult to edit these hard coded field groups so I decided it was best to switch these to JSON. I ran the snippet below once, it converts each of the field groups from […]

Read more

Register Google Maps API Key for ACF

First register a API key for Google Maps then include the following snippet to register the key with ACF. This snippet has two parts — one part defines a constant containing the key, the other hooks into the Google Map ACF field and set the key on the fly.

Read more

Register an ACF Options Page

Register top-level ACF options page Use this snippet to register a top-level menu item to house your custom fields as options. Register sub-level options pages If you need sub-pages, build on the previous snippet using the following example. These snippets can go in either a plugin or your theme’s functions.php file – whatever makes the […]

Read more

Speed up ACF backend loading time

Source: https://www.advancedcustomfields.com/blog/acf-pro-5-5-13-update/

Read more

Built by Hookturn

This site was created by Hookturn, the team behind ACF Theme Code Pro. If you are interested in contributing or have an extension to add, email us.

Sponsored by Pressidium

Awesome ACF is sponsored by the very awesome team at Pressidium. If you need reliable, secure and scalable Managed WordPress Hosting, check them out.

Stay up to date with all things ACF

TODO: Registration form here