I am creating a plugin. That enables users to create forms, & display these with shortcodes on a site. When creating a form (using custom post types), users will be able to add additional form fields with meta boxes.

My question: When a user creates a form (via custom post type), how do I store the field type so the shortcode knows which type to display for the form?

1 Answer 1


Store each field the user creates as an array in a post meta field, the array would contain the name and a reference to the field type. You could also store additional data within the array, like if it's required and the type of validation to apply.

  • Thanks. This is my first plugin, so learning a lot! Would you create a new table to store this array in? Or would you store this in 'meta_value' in the wp_postmeta table? Thanks!!
    – user28566
    Mar 7, 2013 at 20:47
  • in the post meta table
    – Milo
    Mar 7, 2013 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.