WordPress.org

Ready to get started?Download WordPress

Forums

Custom Field Suite
[resolved] Gravity forms custom field update (6 posts)

  1. joseph.c.lawrence
    Member
    Posted 1 year ago #

    Hi,

    I am trying to populate a custom field created with cfs, using the gravity forms edit post plugin. The custom field I have created is ideally a 'relationship' field, but could be any kind of field where the user selects based on the name of another post (custom post type), and the submitted value of the field is the post ID. I then need this value to save in the custom field, and for this not to be unique (multiple values should be able to be added.

    I cannot seem to get this to work, and have tried every combination of selects (drop downs), multiselects and textboxes that I can think of, both as the custom field type, and/or the gravity forms field type. It would be fine to just have a drop down on the gravity form, which would save the post IDs as non unique custom fields, but there seems to be no way to get this to work?

    Thanks so much in advance for any help you can give.

    Joe

    http://wordpress.org/extend/plugins/custom-field-suite/

  2. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

    When you add a new post (using Gravity Forms), does the CFS value get saved correctly?

    Also, is this the plugin you're using?:
    http://wordpress.org/extend/plugins/gravity-forms-update-post/

  3. joseph.c.lawrence
    Member
    Posted 1 year ago #

    Yes that is the plugin I'm using, and I don't actually ever create a post with this custom field, I only want to add it via this plugin, via a form that updates the post.

    In the backend the CFS value can get saved fine of course.

  4. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

    @Joe - I'll have to experiment with that plugin, but my guess is that it'll take some custom coding on your part.

    From what I can see so far, it'll involve using 2 hooks:

    1. gform_post_submission (to properly save the custom field value using CFS' get() method)

    2. {your_field_name}_field_default_value (for properly loading the value into the GF edit form)

  5. joseph.c.lawrence
    Member
    Posted 1 year ago #

    Thanks logikal. I have kind of hacked my way out of it by running a normal wordpress add_post_meta function as per your first suggested hook - this doesn't then properly work with the CFS 'relationship' field type (I just use a text field), and for now I have left multiselect, and just use a dropdown (select).

    Thanks for your help!

  6. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

    No problem!

    The authors of Gravity Forms claim that they'll add support for editing existing forms beginning in GF v1.7.

    http://www.gravityhelp.com/forums/topic/letting-user-edit-their-page-with-gravity-forms#post-32227

    Once that happens, I'll add support for it within CFS. In the meantime, you can track the plugin's progress here:

    https://github.com/logikal16/custom-field-suite/issues?state=open

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic