Please Note: We are no longer using forums to facilitate standard support. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

How to prepopulate a field from a custom field?

  1. Hi All

    I hope someone can help me with a solution on this topic.
    I really really want my form too have pre-populated fields and the fields should be map with a custom field. The form will get the custom field value from wordpress and display it for the form user as ex. a dropdown, multiselect or html...

    it is like the "Gravity Forms + Custom Post Types" plugin but for custom fields...?

    Posted 3 years ago on Wednesday February 8, 2012 | Permalink
  2. Here is a walk through for populating the Post Author. You can use this same concept to populate a custom field. Just use the get_post_meta() function instead of the get_the_author_meta() function used in the walk through.

    Posted 3 years ago on Monday February 13, 2012 | Permalink
  3. Hi David

    Thank you for your reply. I found a custom field/custom post plugin:
    "Ultimate Post Type Manager"

    Here I can make the metadata I want on custom posts.
    1. Make a custom post type "product"
    2. Make fields for details like price and different configuration variants.

    Now I would like to make the orderform which get the metadata from the different posts and their configurations...

    The "GravityForm+custom field" enable a dropdown for population so that I can get the "product" post type. Now I am just missing the get "custom field" function.

    And I guess your ex. with post_author could work but I cant seem to rewrite to make it

    Posted 3 years ago on Thursday February 16, 2012 | Permalink
  4. Hi Jesper,

    Based on the Post Author example above, this code will retrieve a post custom field:

    Make sure you re-read the Post Author example documentation as it provide additional explanation on what is going on here.

    Posted 3 years ago on Thursday February 16, 2012 | Permalink
  5. Hi David

    Can you check the code here:

    Is the $post->post_32 part wrong?
    The parameter in the form is called "pris_in" and the custom field is "pris"

    Posted 3 years ago on Friday February 24, 2012 | Permalink


Support Tickets

Open A New Support Ticket
 Open A New Priority Support Ticket *

* Developer license holders only