Map Existing Custom Fields to Post Form

In the favorable case, we will use the plugin with a totally new custom post type, and we have nothing to talk about.

But, some cases, when you buy the theme with pre-built meta box (includes meta_key), and now you switch to use our User Frontend Submit PRO plugin, but want to map with the current meta_keys so the system will run as we haven’t touched anything.

That’s the ideal case, and I will show you how.

Continue with the pre-built form of real estates frontend post form, we just need to change something.

We will need to focus on 3 points:

  • What’s the current meta_keys
  • Map with the current meta_keys
  • Disable/enable field group effects on the backend.

Hold my beer and let’s get started.

Step 1: Find the current meta_keys

To find the meta key for each field in your meta box, you will:

  • Point the mouse to that field
  • Right-click and select “Inspect Element”
  • Find “name” attribute in the source code, that’s the meta key.

Step 2: Map with the current fields

In this step, we will map the just found meta_key in the source code, with our custom field, so that when the user creates the posts from frontend, the value will be saved to your current form field.

To do that, navigate to your field group setting, and expand the field setting.

On the screenshot, you will see I have select “Meta Field” at Form Field Type option.

That’s it. Next step, disable in the backend.

Step 3: Only work for front-end form

At the field group setting, you scroll down a little bit, you will see the “Settings” section.

Then, you will switch off the “Active” setting.

This will help you only use this field group for front-end post form, else, at your edit post in the back-end, you will see 2 duplicate meta box, 1 from your theme, and 1 for the ACF field group here, that’s not we want, right?

We only want the ACF field group work with front-end post form, then, the front-end post form will save the value to your current meta box, without any changes.


Leave a Comment

Your email address will not be published.

You may use these HTML tags and attributes: <a href=""> <abbr> <acronym> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Send a Message