Title: Mapping form fields
Last modified: September 18, 2018

---

# Mapping form fields

 *  Resolved [kkriss](https://wordpress.org/support/users/kkriss/)
 * (@kkriss)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/mapping-form-fields/)
 * Hello, nice plugin! Is it possible to map fields created with an Happy form to
   Advanced Custom Field custom fields, so that users can submit content directly
   to custom posts types? Thank you

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [thethemefoundry](https://wordpress.org/support/users/thethemefoundry/)
 * (@thethemefoundry)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/mapping-form-fields/#post-10702227)
 * Hey there, [@kkriss](https://wordpress.org/support/users/kkriss/)! 👋
 * HappyForms doesn’t include a way to do that through your interface, we’re sorry!
   It’s definitely possible though (and indeed quite easy) with a simple PHP hook
   and HappyForms submission callbacks. If you’re up for this small challenge, we’d
   be glad to share a practical snippet you can pop in your child theme `functions.
   php` file.
 * Let us know what you think!
 *  Thread Starter [kkriss](https://wordpress.org/support/users/kkriss/)
 * (@kkriss)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/mapping-form-fields/#post-10702489)
 * Hi. thanks for your reply. If you can suggest me how, I will try to do it but
   I can’t code at all, so please explain me step by step how to do it. After that,
   when I’ll have to map fields, will it be easy in a “visual” way? Thank you so
   much.
 *  [thethemefoundry](https://wordpress.org/support/users/thethemefoundry/)
 * (@thethemefoundry)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/mapping-form-fields/#post-10705792)
 * Got it, [@kkriss](https://wordpress.org/support/users/kkriss/)!
 * We’re glad to share a simple snippet, but the actual implementation of the logic
   that follows depends on your plans, and we won’t be really able to help with 
   every step of it. At no point along the path you’ll have visual controls available–
   let us know if this is a total showstopper for you.
 * Here’s a super-basic example – accessing your submission data, and create a post
   with each form part mapped to a post meta field (notice that the `wp_insert_post`
   call intentionally misses some important data, like the post type):
 *     ```
       function child_theme_submission_success( $submission, $form, $message ) {
           wp_insert_post( array(
               'meta_input' => $submission
           ) );
       }
   
       add_action( 'happyforms_submission_success', 'child_theme_submission_success', 10, 3 );
       ```
   
 * We hope that serves as a starting point! Let us know how you go.
    -  This reply was modified 7 years, 8 months ago by [thethemefoundry](https://wordpress.org/support/users/thethemefoundry/).
 *  Thread Starter [kkriss](https://wordpress.org/support/users/kkriss/)
 * (@kkriss)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/mapping-form-fields/#post-10707762)
 * Hi, thank you for the snippet, but I can’t complete it as I can’t code. Would
   you do that for me, considering a CPT called Books and CF such as Title, Description,
   Author? Is that enough? After having added this code to the child functions.php,
   the fields in the CPT will be automatically populated with no other actions? 
   Thanks for your patience.
 *  [thethemefoundry](https://wordpress.org/support/users/thethemefoundry/)
 * (@thethemefoundry)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/mapping-form-fields/#post-10710951)
 * Got it, [@kkriss](https://wordpress.org/support/users/kkriss/)!
 * As much as we’d like to help further with this, we don’t have a direct experience
   with ACF internals, we’re sorry!
 * If you can get in touch with a developer to help you on this, the above snippet
   will probably be just enough for him/her to understand how to pull off this integration.
 * Let us know what you think!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Mapping form fields’ is closed to new replies.

 * ![](https://ps.w.org/happyforms/assets/icon-256x256.png?rev=2778164)
 * [Happyforms - Form Builder for WordPress: Drag & Drop Contact Forms, Surveys, Payments & Multipurpose Forms](https://wordpress.org/plugins/happyforms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/happyforms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/happyforms/)
 * [Active Topics](https://wordpress.org/support/plugin/happyforms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/happyforms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/happyforms/reviews/)

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)

 * 5 replies
 * 2 participants
 * Last reply from: [thethemefoundry](https://wordpress.org/support/users/thethemefoundry/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/mapping-form-fields/#post-10710951)
 * Status: resolved