PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. 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.

using gravity_form() with add_meta_box() for custom field editing

  1. I am able to get my gravity form to show as a meta box in the custom post type of my choice however it looks like I am going to need some help to get any further. The form seems to be displaying as it would in the edit form screen just without the necessary javascript.


    add_action("admin_init", "dsh_admin_init");

    function dsh_admin_init(){
    add_meta_box( 'new-gravity-boxes', 'Gravity Forms - Property Profile', 'gf_custom_meta_box', 'property', 'normal', 'high' );
    }

    function gf_custom_meta_box(){
    gravity_form(2, false, false);
    }

    The output looks like this: http://designseohosting.com/wp-content/uploads/2011/04/add_meta_box-using-a-gravity-form.png

    I just want to edit my custom field data with a form created by gravity forms. Can I accomplish this with some hooks or filters if I populate the form fields from the custom meta data values?

    Posted 13 years ago on Wednesday April 27, 2011 | Permalink
  2. I'm not sure if this is going to work the way you have implemented it, because it's effectively a form within a form. What may be a better option is creating all the post creation options in a Gravity Form and then using that form to create the post. Embedding the form within the Post Editor itself isn't going to function properly because it's not designed to work there.

    Posted 13 years ago on Wednesday April 27, 2011 | Permalink
  3. I do plan on creating the posts from the front end with a gravity form. The main goal with this add_meta_box() implementation is to create a management interface for all the custom field data that will be collected and attached to the posts during the post creation process.

    Using the custom field boxes is kind of clunky for most people...so I am just looking for a solution that doesn't require recreating all of the form and validation stuff that GF does so easily elegantly already.

    http://wordpress.org/extend/plugins/advanced-custom-fields/ seems be be the closest thing I can find that implements a gravity form 'ish solution to this.

    ...seems like it would make a pretty killer addon hint. hint. ;)

    Posted 13 years ago on Wednesday April 27, 2011 | Permalink