Advanced Custom Fields Integration

You may want to add custom information to your user profiles and your private content. For example, to keep track of your customer addresses and phone numbers, or simply to add a field to indicate a due date on your invoices. The Advanced Custom Fields Integration allows you to do that with the help of the Advanced Custom Fields plugin by Elliot Condon (aka. ACF).

Setup

ACF Integration can be easily installed by uploading the corresponding zip file to your WordPress site’s plugins directory. If you don’t know how to do that, please refer to our guide about installing add-ons.

Once installed and active, the ACF Integration add-on should be complaining that you don’t have the ACF plugin (or that the one you have is not active, or not a supported version). We bundle a tested and supported version with our ACF Integration add-on. That zip file is located in customer-area-acf-integration/acf-supported-release and can be installed in the same way as you have installed the add-on.

Once both ACF and ACF Integration are installed and active, there should be no error message left and you can start adding the fields you want.

Using the Advanced Custom Fields plugin

In this quick tutorial, we will not cover the use of the ACF plugin. Elliot and his team already have a very well made documentation and you should have a look at it in order to understand how it works. We will focus in the next two sections on the practical use of ACF to add information to our user profiles and to private content.

User profile fields

  1. Create a field group (see the ACF documentation about creating field groups)
  2. Now, we will configure the group to make it appear in the user profile. In the “location” box, set the “show this group if” dropdown to “User”. This means that this group and the corresponding fields will be visible on the user related pages (profile pages and forms in the frontend and in the admin area).
  3. Finally, give that group a title and start adding fields.
  4. If you want the group title to be hidden on the pages, in the options box, set the style option to “Seamless”. Else, set it to default/post box.

Private content fields

  1. Create a field group (see the ACF documentation about creating field groups)
  2. Now, we will configure the group to make it appear only for the private content type we want. In the “location” box, set the “show this group if” dropdown to “Post type” / “is equal to” / “cuar_private_file”. This means that the group and the corresponding fields will only be visible for private files. You can of course change “cuar_private_file” to “cuar_private_page” for private pages or to “cuar_conversation” for conversations.
  3. Finally, give that group a title and start adding fields.
  4. If you want the group title to be hidden on the pages, in the options box, set the style option to “Seamless”. Else, set it to default/post box.