Advanced Custom Fields (ACF)
How to use Whalesync's WordPress connector with ACF
Whalesync supports syncing Custom Post Types and Custom Fields with ACF
To use ACF Custom Fields, you'll need to toggle the setting "show in REST API" on for each Field Group you want to use:
Currently when we get the schema for ACF fields via API does not differentiate between a simple integer and an integer id to another table. In other words we can't tell integers from pointers to Media or Users. We have created a mechanism for you to configure an ACF field and signal to Whalesync to treat it as a foreign key.
Here are the steps you need to take if you have an image or author fields and you want Whalesync to threat them as foreign keys:
- Let's say that I have a column that I have labeled "Image". At the end of the filed name (not the label!) add "_fk" as that will designate it as a foreign key to Whalesync.
- Then after that add "_media" or "_users" to designate that it should point to the Media or Users table respectively.
- So at the end the column name will be for example "image_fk_media" or "author_fk_users". Make sure that each ACF field name is unique.
- Set up your sync in Whalesync as normal. Map the foreign key array of one connector to the WordPress.org "image_fk_media" in this connector.
- Save and sync.